problem in c program..
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..?
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..?
0