我在我的解决方案中包含了stdint.h并使用了uint64_t,但结果不是我想要的。这是我使用的代码。
#include <stdio.h>
#include "./stdint.h"
void main (void)
{
//-- to get the maximum value that the 32-bit integer can take
unsigned int test = 0 ;
test-- ;
//-- to see if the 64-bit integer can take the value that the 32-bit integer can't take
uint64_t test2 = test ;
test2++ ;
printf("%u\n", test) ;
printf("%u\n", test2) ;
while(1) { }
}
这是结果。
4294967295
0
我想使用 64 位整数可以采用的全部范围。我如何在 x86 Visual Studio 2008 中做到这一点?供您参考,我使用的是 32 位 Windows 7。