#include<stdio.h>
int main(){
//声明一个二维指针数组
//先把每个指针元素声明出来
int a,b,c=1,d,e,f;
int *p1=&a;
int *p2=&b;
int *p3=&c;
int *p4=&d;
int *p5=&e;
int *p6=&f;
int *p[2][3]={{p1,p2,p3},{p4,p5,p6}};
int *ptemp=p[0][2];
int j=10;
int *p7=&j;
int **p8=&p7;
int ***p9=&p8;
printf("*p7=%d,**p8=%d,***p9=%d \t,p8=%p,**p9=%p\n",*p7,**p8,***p9,p8,**p9);
printf("p3=%p,ptemp=%p,c=%d\n",p3,ptemp,*ptemp);
return 0;
} |
|