I have a question about a pointer to 2d array. If an array is something like
int a[2][3];
then, is this a pointer to array a
?<
The [3]
is a part of the type. In this case p
is a pointer to an array of size 3 which holds ints.
The particular type of an array always includes its size, so that you have the types int *[3]
or int *[5]
, but not just int *[]
which has undefined size.
int *x[20]; /* type of x is int *[20], not just int *[] */
int y[10][10]; /* type of y is int[10][10], not just int[][] */