| 数据类型 | 数据类型 | 字节 | 取值范围 |
| char | 字符 | 1 | |
| short | 短整型 | 2 | |
| int | 整型 | 4 | |
| long | 长整型 | 4 | |
| long long | 更长的整型 | 8 | |
| float | 单精度浮点数 | 4 | 链接 |
| double | 双精度浮点数 | 8 | 链接 |
数据类型 取值范围
char -128 ~ +127
short -32768 ~ +32767
int -2147483648 ~ +2147483647
long -2147483648 ~ +2147483647
long long -9223372036854775808 ~ +9223372036854775807
float -340282346638528859811704183484516925440 ~
+340282346638528859811704183484516925440
double 太大了,不写了
2、float、double的精度
float 的精度为 6~7 位
double 的精度为 15~16 位
链接
3、C语言编程环境中查看数据类型所占字节int main()
{
//sizeof - 关键字 - 操作符 - 计算类型或者变量所占空间的大小
printf("%dn", sizeof(char));//1
printf("%dn", sizeof(short));//2
printf("%dn", sizeof(int));//4
printf("%dn", sizeof(long));//4
printf("%dn", sizeof(long long));//8
printf("%dn", sizeof(float));//4
printf("%dn", sizeof(double));//8
printf("%dn", sizeof(long double));//8
return 0;
}



