69,373
社区成员
发帖
与我相关
我的任务
分享
char *p;
void func3()
{
int i=0;
char *p1=0, *p2;
printf("\n p1 = 0x%08x, and &p1 = 0x%08x\n", p1, &p1);
printf("\n p2 = 0x%08x, and &p2 = 0x%08x\n", p2, &p2);
p1 = "abc";
p2 = "abc";
printf("\n the address of string abc is 0x%08x\n ", "abc");
printf("\n p1 = 0x%08x, and &p1 = 0x%08x\n", p1, &p1);
printf("\n p2 = 0x%08x, and &p2 = 0x%08x\n", p2, &p2);
}
void main()
{
func3();
}
p1 = 0x00000000, and &p1 = 0x0061ff18
p2 = 0x00401c00, and &p2 = 0x0061ff14
the address of string abc is 0x0040512d
p1 = 0x0040512d, and &p1 = 0x0061ff18
p2 = 0x0040512d, and &p2 = 0x0061ff14