C语言中各数据类型占用字节和值范围
2025/4/3 10:39:59
来源:https://blog.csdn.net/qq_41286666/article/details/139648039
浏览:
次
关键词:C语言中各数据类型占用字节和值范围
数据类型 | 占用字节 | 值范围 |
---|
char | 1 | -128 ~ 127 |
unsigned char | 1 | 0 ~ 255 |
short | 2 | -32768 ~ 32767 |
unsigned short | 2 | 0 ~ 65535 |
int | 4 | -2147483648 ~ 2147483647 |
unsigned int | 4 | 0 ~ 4294967295 |
float | 4 | 1.17549435110^-38 ~ 3.40282346610^38 |
double | 8 | 2.225073858507201410^-308 ~ 1.797693134862315810^308 |
long double | 16 | 3.4 * 10^-4932 ~ 1.1 * 10^4932 |
long | 8 | -9223372036854775808 ~ 9223372036854775807 |
unsigned long | 8 | 0 ~ 18446744073709551615 |
long long | 8 | -9223372036854775808 ~ 9223372036854775807 |
unsigned long long | 8 | 0 ~ 18446744073709551615 |