Could anyone explain me output of this code:
struct X {struct X *p; short a, *b;};
struct X x, *p=&x;
printf("0:%x\n", p);
printf("1:%x\n", sizeof(*p));
printf("2:%x\n", &p->a);
printf("3:%x\n", &p->b);
printf("4:%x\n", ++p);
printf("5:%x\n", p-&x);
printf("6:%x\n", &x-p);
输出是
为什么 *p =18 的大小? 其他线路也让我感到困惑。 谢谢
两点备注: