#include<stdio.h>
int main()
{
int *pp[3]; //定义一个数量为三个指针的指针数组
int a1=0; //定义三个变量
int a2=1;
int a3=1;
pp[0]=&a1; //给指针数组的三个指针赋值
pp[1]=&a2;
pp[2]=&a3;
printf("*pp[3]的第一个指针的地址是:%p\n",pp[0]);
printf("取出*pp[3]的第一个指针的地址对应的数值:%d\n",*pp[0]);
printf("------------------------------------------------------------------------------\n");
printf("*取出a1地址对应的数值:%d\n",*(&a1));
printf("*取出a2地址对应的数值:%d\n",*(&a2));
printf("------------------------------------------------------------------------------\n");
printf("*取出a2地址对应的数值:%d\n",*(pp[0]+1));
printf("------------------------------------------------------------------------------\n");
printf("pp[0]=\t%p\n",pp[0]);
printf("*pp=\t%p\n",*pp);
printf("&a1=\t%p\n",&a1);
printf("------------------------------------------------------------------------------\n");
printf("&pp=\t%p\n",&pp);
printf("pp=\t%p\n",pp);
printf("&pp[0]=\t%p\n",&pp[0]);
printf("------------------------------------------------------------------------------\n"); |
|