<分区>
Possible Duplicate:
What the pointer size in 64 bits computer in C++?
我在大学学习 C。
我尝试在 Windows 7/8 上设置编程环境,但遇到问题
这段代码:
int main()
int *p;
printf("%d",sizeof(p));
return 0;
}
打印 4 而不是 8(大学中打印 8)。 我能做什么?
我的 Windows 是 64 位和 x64 处理器。
标签 c
<分区>
Possible Duplicate:
What the pointer size in 64 bits computer in C++?
我在大学学习 C。
我尝试在 Windows 7/8 上设置编程环境,但遇到问题
这段代码:
int main()
int *p;
printf("%d",sizeof(p));
return 0;
}
打印 4 而不是 8(大学中打印 8)。 我能做什么?
我的 Windows 是 64 位和 x64 处理器。
最佳答案
您可能将代码编译成 32 位应用程序。您需要将其编译为 64 位应用程序。检查你的编译器设置。您的操作系统是 64 位并不重要。
关于c - 指针大小不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13343619/