void m() { char a[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; char(*c)[3][3] = (char (*)[3][3])a; printf("%d\n", *c[0][0]); }
For example, in this function, the variable a indicates a place in memory with 9 integers per line.
But what about c ? Does c indicate a memory location that points to a memory location containing 9 integers in a string?
So, technically, c pointer to one layer or a pointer to two layers?
Can't you say what I said above? When I execute the following function:
void m() { char a[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; char(*c)[3][3] = (char (*)[3][3])a; printf("%d\n", *c[0][0]); printf("a...%p\nc...%p\n", a, c); }
a and c both point to the same locations? Should it not be a two-layer pointer, and a should be a pointer to a location in memory?