True2009Fans
c/c++中int,long,long long的取值范围:
unsigned int 0~4294967295
int -2147483648~2147483647
unsigned long 0~4294967295
long -2147483648~2147483647
long long的最大值:9223372036854775807
long long的最小值:-9223372036854775808
unsigned long long的最大值:18446744073709551615 //20位
类型 | 占用存储空间 | 表数范围 |
byte | 1字节 | -2^7 ~ 2^7-1(-128~127) |
short | 2字节 | -2^15 ~ 2^15-1(-32768~32767) |
int | 4字节 | -2^31 ~ 2^31-1 (-2147483648~2147483647) 约21亿 |
long | 8字节 | -2^63 ~ 2^63-1 |
__int64的最大值:9223372036854775807
__int64的最小值:-9223372036854775808
unsigned __int64的最大值:18446744073709551615