答:1.p+i
2.p[i]
3.(*p)[i]
代码演示: #include <stdio.h>
int main(int argc,const char * argv[])
{
int a[] = {1,2,3};
int *p = a;
int (*p1)[3] = &a;
for(int i = 0;i < 3;i ++)
{
printf("%d \t",*(p + i));
printf("%d \t",p[i]);
printf("%d \t",(*p1)[i]);
}
return 0;
}
|
|