problem in c program..

anksingla

anksingla

@anksingla-ttYJbX Oct 23, 2024
Below program is to print the values of 2d array s.

int s[][2]={12,1,13,214,3};

int i,j;
int (*p)[2];
int *pint;
For(i=0;i<3;++i)
{
p=&s;
pint=(int*)p;
for(j=0;j<2;++j)
printf("%d",*(pint+j));
}
This will print values stored in array .
In the above program in printf statement we use *(pint+j) which prints value.
But if *(*p+j) is use instead of *(pint+j), then also program remains same.
Is this means pint=*p ??
How *(*p+j) works same as *(pint+j)??
Can anyone explain..?

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform