基本类型的存储Storage of Basic Types

下表汇总了与每个基本类型关联的存储。The following table summarizes the storage associated with each basic type.

基础类型的大小Sizes of Fundamental Types

类型Type 存储Storage
charunsigned char、signed charchar, unsigned char, signed char 1 个字节1 byte
short、unsigned shortshort, unsigned short 2 个字节2 bytes
int, unsigned intint, unsigned int 4 个字节4 bytes
long、unsigned longlong, unsigned long 4 个字节4 bytes
floatfloat 4 个字节4 bytes
doubledouble 8 个字节8 bytes
long double 8 个字节8 bytes

C 数据类型属于常规类别。The C data types fall into general categories. “整型类型”包括 charint、short、long、signed、unsignedenumThe "integral types" include char, int, short, long, signed, unsigned, and enum. “浮点型”包括 float、double 和 long doubleThe "floating types" include float, double, and long double. “算术类型”包括所有浮点型和整型。The "arithmetic types" include all floating and integral types.

请参阅See Also

声明和类型Declarations and Types