指针细节
#include<stdio.h>
#include<stdlib.h>
void main()
{
int age = 10;
int *p;
int **pp;
p = &age;
pp = &p;
printf("age的值是:%d\n",age);
printf("age的地址是:%d\n",&age);
printf("--------------------------------\n");
printf("p的值是:%d\n",p);
printf("p的地址是:%d\n",&p);
printf("p指向age的值是:%d\n",*p);
printf("--------------------------------\n");
printf("pp的值是:%d\n",pp);
printf("pp的地址是:%d\n",&pp);
printf("*pp指向p的值是:%d\n",*pp);
printf("**pp指向age的值是:%d\n",**pp);
system("pause");
}
//多画图就能看明白;
#include<stdlib.h>
void main()
{
int age = 10;
int *p;
int **pp;
p = &age;
pp = &p;
printf("age的值是:%d\n",age);
printf("age的地址是:%d\n",&age);
printf("--------------------------------\n");
printf("p的值是:%d\n",p);
printf("p的地址是:%d\n",&p);
printf("p指向age的值是:%d\n",*p);
printf("--------------------------------\n");
printf("pp的值是:%d\n",pp);
printf("pp的地址是:%d\n",&pp);
printf("*pp指向p的值是:%d\n",*pp);
printf("**pp指向age的值是:%d\n",**pp);
system("pause");
}
//多画图就能看明白;