【发布时间】:2012-10-10 05:55:13
【问题描述】:
我想打印 4 个字节的无符号整数的最大值。
#include "stdafx.h"
#include "conio.h"
int _tmain(int argc, _TCHAR* argv[])
{
unsigned int x = 0xffffffff;
printf("%d\n",x);
x=~x;
printf("%d",x);
getch();
return 0;
}
但我得到的输出是 -1 和 0。我怎样才能打印 x = 4294967295?
【问题讨论】:
-
使用库
limits.h(我不确定,但它可能是一个c++库)
标签: c