From what I understand:
int B[2][3];
int* p=B;
doesn't work because B isn't a pointer to int but a pointer to an array of 3 ints. But it does not contradict the fact that B still points to the first element in the array, which is an int. so why *p or *B does not contain the value of B[0][0]?
How can something be a pointer to "an array of ints"? a pointer can only point at a single address in memory, not at all 3 addresses. It follows that B should always point to the address where the first element is, doesn't matter how long the memory block is.
Please explain why my reasoning doesn't work because I'm having a hard time fully understanding it. Thanks.
int (*p)[3];is a pointer to an array of 3 ints.int (*p)[3] = B;would be the correct syntax and you can usepthe same way as you would useB, except that you can incrementpandsizeof pwill yield to a different result (thx @Olaf).sizeof(p)will yield a different result.int* p = &B[0][0]works.int* p=B[0]is shorthand for the above.