int a[2][3];
a read as array 2 of array 3 of int, which is simply an array of arrays. When you write
int (*p)[3] = a;
It declares p as a pointer to the first element, which is an array. Thus, p points to an array of 3 ints, which is an element of an array of arrays.
Consider the following example:
int a[2][3] +----+----+----+----+----+----+ | | | | | | | +----+----+----+----+----+----+ \_____________/ | | | p int (*p)[3]
Here p is your pointer, which points to an array of 3 ints, which is an element of an array of arrays.
cpx Dec 23 '11 at 3:17 2011-12-23 15:17
source share