标签:
void pointer(int *p)
{
int a = 11;
printf("\nthe p is %p , addr is %p, *p is %d",p , &p, *p);
*p =11;
printf("\nthe p is %p , addr is %p, *p is %d",p , &p, *p);
p = &a;
printf("\nthe p is %p , addr is %p, *p is %d",p , &p, *p);
}
int main()
{
int b =22;
int *p = &b;
printf("the p is %p , addr is %p, *p is %d",p , &p, *p);
pointer(p);
printf("\nthe p is %p , addr is %p, *p is %d\n",p , &p, *p);
}
运行结果:
the p is 00A0FEE4 , addr is 00A0FEDC, *p is 22
the p is 00A0FEE4 , addr is 00A0FEE0, *p is 22
the p is 00A0FEE4 , addr is 00A0FEE0, *p is 11
the p is 00A0FEE8 , addr is 00A0FEE0, *p is 11
the p is 00A0FEE4 , addr is 00A0FEDC, *p is 11
pointer p, addr of pointer p, value of *p
标签:
原文地址:http://www.cnblogs.com/FEMONT/p/4579869.html