类型名 | 字长/B | 取值范围 |
---|---|---|
bool | {false,true} | |
(signed) char | 1 | -128~127 |
unsigned char | 1 | 0~255 |
(signed) short (int) | 2 | -32768~32767 |
unsigned short (int) | 2 | 0~65535 |
(signed) int | 4 | -2147483648~2147483647 |
unsigned (int) | 4 | 0~4294967295 |
(signed) long (int) | 4 | -2147483648~2147483647 |
unsigned long (int) | 4 | 0~4294967295 |
float | 4 | -3.4E(+/-)38~3.4E(+/-)38 |
double | 8 | -1.7E(+/-)308~1.7E(+/-)308 |
long double | 10 | -3.4E(+/-)4932~3.4E(+/-)4932 |
C++基本类型及派生类型的字长及值域
最新推荐文章于 2023-05-15 22:58:11 发布