发布时间:2026-07-20阅读(1)
C语言中声明变量或者函数时需要给出其数据类型,不同的数据类型所表示的数据格式,存储空间都不同,C语言的类型可以总结为四种:


整数类型:在单片机中常用的整数类型有:char、unsigned char、int、unsigned int、long、unsigned long
浮点类型:float、double、long double
Void:空类型
数据类型字节大小数值范围
char 1 Byte (-2^7, 2^7 - 1)
uchar 1 Byte (0,2^8 - 1)
short 2 Byte (-2^15, 2^15 - 1)
ushort 2 Byte (0, 2^16 - 1)
int 4 Byte (-2^31, 2^31 - 1)
uint 4 Byte (0, 2^32 - 1)
long 4 Byte (-2^31, 2^31 - 1)
ulong 4 Byte (0, 2^32 - 1)
float 4 Byte (-2^31, 2^31 - 1)
double 8 Byte (-2^63, 2^63 - 1)
long long 8 Byte (-2^63, 2^63 - 1)

Copyright © 2024 有趣生活 All Rights Reserve吉ICP备19000289号-5 TXT地图HTML地图XML地图