I am new to C programming and have been looking for this question for few days...
int arr[][2]={11,22,33,44,55,66};
int (*ptr)[2]=&arr[1]; //line a
int (*ptr1)[2]=arr[1]; //line b
For line (a) compiler has no issue but for line (b) it gives ERROR-cant convert int* to int[2]*
Now both &arr[1]
and arr[1]
have same size(when I checked in sizeof operator).
So please help me understand what exactly is happening? what is the difference between arr[1]
and &arr[1]
? Thank you!