P170. Understanding (Pointer to an array).
#include<stdio.h>
void
main()
{
int a[5]={10,20,30,40,50};
int *ip;
int(*p)[5];
ip=a;
p=&a;
int i;
for(i=0;i<5;i++)
printf("%d
",(*p)[i]);
printf("\n");
printf("ip= %u *ip=%u
\n",ip,*ip);
printf("p= %u *p=%u **p=%u
\n",p,*p,**p);
printf("p+1= %u *p+1= %u **p+1=
%u",p+1,*p+1,**p+1);
printf("\n");
}
Comments
Post a Comment