#include <stdio.h> int main(void) { int a=10; int *p = &a; *p = 89; printf("变量值a=%d a=%d ", a,*p);//0x7fff8af18554 printf("指针地址p=%p p=%p ",p,&a);//0x7fff8af18554 printf("指针地址p=%#lx p=%#lx ",p,&a);//0x7fff8af18554 return 0; }
#include <stdio.h> int main(void) { int a=10; int *p = &a; *p = 89; printf("变量值a=%d a=%d ", a,*p);//0x7fff8af18554 printf("指针地址p=%p p=%p ",p,&a);//0x7fff8af18554 printf("指针地址p=%#lx p=%#lx ",p,&a);//0x7fff8af18554 return 0; }