I have met some questions about pointer in C.
int main()
{
int a[5][2] = {0,1,2,3,4,5,6,7,8,9};
int *p = a[0];
int (*p2)[2] = &a[1];
++p;
++p2;
// 1, a[0][1]
printf("%d\n",*p);
// 4, a[2][0]
printf("%d\n",**p2);
// 9, but I think it would run out of index. (2 > 1) -> error
printf("%d \n",p2[1][2]);
return 0;
}
Could anyone give me some comments about it.
BTW, How to get 5 using pointer p2?
Can *(*p2+1) get 5 ?
Thanks.