c语言关于指针的超级难题



```c
#include
#include
struct test{
    
}*p;
//假设p的地址为0x100000,如下表达式的值各是多少?
//已知,结构体test类型的大小为20个字节 
int main(){
printf("%p\n",p+0x1);
//printf("%p\n",(unsigned long)p+0x1); 
printf("%p\n",(unsigned int*)p+0x1);
//printf("%d",sizeof(unsigned int* )); 
return 0;
}

运行结果:

![img](https://img-mid.csdnimg.cn/release/static/image/mid/ask/565485012266142.png "#left")

我的疑问是printf("%p\n",(unsigned int*)p+0x1);不应该跳过一个(unsigned int*)型吗?我的系统是64位,所对应的指针是8个字节,
也就是跳了8个字节,那第二个结果不应该是0000000000000008

(unsigned int*)p+0x1跳过的是unsigned int类型的大小

int 是32位的,与系统无关。如果要使用64位的,需要用 long long *或者 __int64 *的指针类型。