main()
{
int m,row, col;
int *ptr ,sum = 0 ;
int arr[2][2][2] ={1,2,3,4,5,6,7,8};
int(*p)[2][2] ;
p = arr;
for(m=0;m<2;m++)
1 {
ptr = p+m;
for(row= 0 ;row<2;row=row+2)
{
ptr = ptr + row ;
for(col=0;col<2;col=col+1)
{
sum = sum + *(ptr+col);
}
}
}
printf("%d",sum);
}
can someone show me with a diagram how it is processing morever , at ptr = p + m , when control go here ptr stores 1 , my question is ptr should hold address because its a pointer , thanks