C语言 int数据类型的取值范围
我们知道,一般情况下,int数据类型占用4字节的内存空间,取值范围:-2147483648 ~ 2147483647
int数据类型的下限是-2147483648,上限是2147483647。
int m = 2147483647;GCC编译器编译正常;而int m = -2147483648;GCC编译器编译警告:
tester.c: In function 'main':
tester.c:5:5: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
为什么???
unsigned int是无符号整型,而int m = -2147483648U;GCC编译器编译正常,为什么??