
1、bool占用内存1 字节存储类型无符号布尔类型取值范围false (0) 、true (非 0逻辑上只有两个状态)2、char占用内存1 字节存储类型实现定义部分编译器 signed char、部分 unsigned char取值范围若 signed char[-128 , 127]若 unsigned char[0 , 255]3、signed char占用内存1 字节存储类型有符号字符型取值范围[-128 , 127]4、unsigned char占用内存1 字节存储类型无符号字符型取值范围[0 , 255]5、short /short int占用内存2 字节存储类型有符号短整型取值范围[-32768 , 32767]6、unsigned short /unsigned short int占用内存2 字节存储类型无符号短整型取值范围[0 , 65535]7、int占用内存4 字节存储类型有符号基本整型取值范围[-2147483648 , 2147483647]8、unsigned int占用内存4 字节存储类型无符号基本整型取值范围[0 , 4294967295]9、long /long int占用内存Windows (4 字节)Linux/macOS 64 位 (8 字节)存储类型有符号长整型Windows 范围[-2147483648 , 2147483647]Linux64 范围[-9223372036854775808 , 9223372036854775807]10、unsigned long /unsigned long int占用内存Windows (4 字节)Linux/macOS 64 位 (8 字节)存储类型无符号长整型Windows 范围[0 , 4294967295]Linux64 范围[0 , 18446744073709551615]11、long long /long long int占用内存8 字节存储类型有符号长长整型取值范围[-9223372036854775808 , 9223372036854775807]12、unsigned long long /unsigned long long int占用内存8 字节存储类型无符号长长整型取值范围[0 , 18446744073709551615]13、float占用内存4 字节存储类型单精度浮点IEEE754取值范围±3.402823466e38有效精度约 6~7 位十进制小数14、double占用内存8 字节存储类型双精度浮点IEEE754取值范围±1.7976931348623158e308有效精度约 15~16 位十进制小数15、long double占用内存Windows MSVC (8 字节等同于 double)GCC (16 字节)存储类型扩展精度浮点GCC 取值范围±1.1897314922317407e4932有效精度约 18~19 位十进制小数16、wchar_t占用内存Windows (2 字节)Linux (4 字节)存储类型宽字符类型Windows 范围[0 , 65535]Linux 范围[0 , 4294967295]17、char8_t (C20 新增)占用内存1 字节存储类型UTF-8 字符类型取值范围[0 , 255]18、char16_t (C11 新增)占用内存2 字节存储类型UTF-16 字符类型取值范围[0 , 65535]19、char32_t (C11 新增)占用内存4 字节存储类型UTF-32 字符类型取值范围[0 , 4294967295]