C++ 为什么整数最大位返回的值小于64?
我正试图找出Windows宏C++ 为什么整数最大位返回的值小于64?,c++,windows,C++,Windows,我正试图找出Windows宏\u INTEGRAL\u MAX\u BITS MSDN表示,无论何时使用\uuu int64 #if defined (_INTEGRAL_MAX_BITS) && \ _INTEGRAL_MAX_BITS >= 64 typedef signed __int64 int64; typedef unsigned __int64 uint64; #else #error __int64 type not su
\u INTEGRAL\u MAX\u BITS
MSDN表示,无论何时使用
\uuu int64
#if defined (_INTEGRAL_MAX_BITS) && \
_INTEGRAL_MAX_BITS >= 64
typedef signed __int64 int64;
typedef unsigned __int64 uint64;
#else
#error __int64 type not supported
#endif
为什么我会看到整数\u MAX\u位的值低于32?中的答案显示,在32位窗口中,long
是64位。声明
_INTEGRAL_MAX_BITS-将整数类型的最大大小(以位为单位)报告为整数文本
由于long-long
是一种整数类型,因此即使在32位窗口上,也应返回64位的最低值,对吗?
如果有必要,为什么\u INTEGRAL\u MAX\u BITS>=64
部分是的呢?该文档适用于Visual Studio 6.0。Visual Studio 6.0于1998年发布,这是在任何long
标准化之前发布的,不支持它。它确实支持您在文档中看到的\uuuu int64
,因此可以无条件地使用它,但对\u INTEGRAL\u MAX\u BITS
的检查可能是为了为更旧版本的Visual Studio获得更好的错误消息。“\uuuu int64类型不受支持”是一条有用的错误消息。类似于“意外标记'int64'之前的语法错误”的消息不是有用的错误消息