GCC 使用 sizeof(long)=8
编译程序,而 Visual Studio 使用 sizeof(long)=4
。如何在 Windows x64 上将 sizeof(long) 设置为 8 字节?
最佳答案
long
的实际大小isn't specified to be an exact number of bytes ,只有它必须能够表示的值范围。但是,您可以使用固定宽度的整数
std::int64_t
这与其他固定宽度整数类型一起在 <cstdint>
中可用。
关于c++ - 有什么方法可以设置 8 字节 (x64) 的 C++ 长类型大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31006426/