| 类型 | 位 | 范围 |
|---|---|---|
| char (字符型) | 1 个字节 | -128 到 127 或者 0 到 255 |
| unsigned char (无符号字符型) | 1 个字节 | 0 到 255 |
| signed char | 1 个字节 | -128 到 127 |
| int (整型) | 4 个字节 | -2147483648 到 2147483647 |
| unsigned int (无符号整型) | 4 个字节 | 0 到 4294967295 |
| signed int | 4 个字节 | -2147483648 到 2147483647 |
| short int (短整型) | 2 个字节 | -32768 到 32767 |
| unsigned short int (无符号短整型) | 2 个字节 | 0 到 65,535 |
| signed short int | 2 个字节 | -32768 到 32767 |
| long int (长整型) | 8 个字节 | -9,223,372,036,854,775,808 到 9,223,372,036,854,775,807 |
| long long | 8 | -9223372036854775808 到 9223372036854775807 |
| unsigned long long | 8 | 0 到 18446744073709551615 (20位) |
| signed long int | 8 个字节 | -9,223,372,036,854,775,808 到 9,223,372,036,854,775,807 |
| unsigned long int (无符号长整型) | 8 个字节 | 0 to 18,446,744,073,709,551,615 |
| float (单精度) | 4 个字节 | +/- 3.4e +/- 38 (~7 个数字) |
| double (双精度) | 8 个字节 | +/- 1.7e +/- 308 (~15 个数字) |
| long double (长双精度) | 8 个字节 | +/- 1.7e +/- 308 (~15 个数字) |
| wchar_t(宽字符型) | 2 或 4 个字节 | 1 个宽字符 |
原文:https://www.cnblogs.com/liming19680104/p/10436341.html