Suppose I declare a 2-D array as:
int a[10][10];
As per my understanding, a is double pointer of type int.
Suppose I declare a pointer to an entire row as follows.
int (*p)[10];
Also a[0]
points to the row 0, a[1]
points to row 1...and so on.
So I tried to initialise p as
p = a[0]; /* so that p can point to row 0 */
I get a compiler warning of incompatible pointer assignment. But if i write
p = a;
This works fine.
Can someone tell me what I am undertaking wrong here?