include <stdio.h>
int main()
{
int a[][3] = {1, 2, 3, 4, 5, 6};
int (*ptr)[3] = a;
printf("%d %d ", (*ptr)[1], (*ptr)[2]);
++ptr;
printf("%d %d\n", (*ptr)[1], (*ptr)[2]);
return 0;
int (*ptr)[3] = a; // here ptr is pointer to an array of 3 integers.
At first ptr is pointing to first row. Say address of 1st row is 2000
So, (*ptr)[1]=*(2004)=2 and (*ptr)[2]=*(2008)=3
Now ++ptr
is updating pointer to next row. So, Now ptr pointing to address 2000+3*4=2012
So, Now So, (*ptr)[1]=*(2016)=5
and (*ptr)[2]=*(2020)=6