C语言指针的使用例子(1)指针地址的输出

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

	
	
	return 0;
}

  

posted @ 2018-03-03 21:39  王默默  阅读(6134)  评论(0编辑  收藏  举报