用于整数溢出
type | min | max | hex | format |
---|---|---|---|---|
int | -2147483648 | 2147483647 (2^31 - 1) | 0x7FFFFFFF | %d |
unsigned int | 0 | 4294967295 (2^32 - 1) | 0xFFFFFFFF | %u |
long (32位) | -2147483648 | 2147483647 (2^31 - 1) | 0x7FFFFFFF | %ld |
long (64位) | -9223372036854775808 | 9223372036854775807 (2^63 - 1) | 0x7FFFFFFFFFFFFFFF | %ld |
unsigned long (32位) | 0 | 4294967295 (2^32 - 1) | 0xFFFFFFFF | %lu |
unsigned long (64位) | 0 | 18446744073709551615 (2^64 - 1) | 0xFFFFFFFFFFFFFFFF | %lu |
long long | -9223372036854775808 | 9223372036854775807 (2^63 - 1) | 0x7FFFFFFFFFFFFFFF | %lld |
unsigned long long | 0 | 18446744073709551615 (2^64 - 1) | 0xFFFFFFFFFFFFFFFF | %llu |
__int8 | -128 | 127 | 0x7F | %hhd |
unsigned __int8 | 0 | 255 | 0xFF | %hhu |
__int16 | -32768 | 32767 | 0x7FFF | %hd |
unsigned __int16 | 0 | 65535 | 0xFFFF | %hu |
__int32 | -2147483648 | 2147483647 | 0x7FFFFFFF | %d |
unsigned __int32 | 0 | 4294967295 | 0xFFFFFFFF | %u |
__int64 | -9223372036854775808 | 9223372036854775807 (2^63 - 1) | 0x7FFFFFFFFFFFFFFF | %lld |
unsigned __int64 | 0 | 18446744073709551615 (2^64 - 1) | 0xFFFFFFFFFFFFFFFF | %llu |