69,373
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
struct BBB
{
long num;
char* name;
short int data;
char ha;
short ba[5];
}*p;
void main(void)
{
p=NULL;
printf("sizeof(*p):%d\n", sizeof(*p)); //24
printf("p:%d\n", p); //0x0
printf("p+0x200:%d\n", p+0x200); //0xx+0x200*24
printf("(unsigned long)p+0x200:%d\n", (unsigned long)p+0x200); //0x0+0x200
printf("(char*)p+0x200:%d\n", (char*)p+0x200); //0x0+0x200
printf("(int*)p+0x200:%d\n", (int*)p+0x200); //0x200*4
}