表格预览
数据类型 | 16位操作系统(byte) | 32位操作系统(byte) | 64位操作系统(byte) | 取值范围 |
char | 1 | 1 | 1 | -128 ~ 127 |
unsigned char | 1 | 1 | 1 | 0 ~ 255 |
short int / short | 2 | 2 | 2 | -32768~32767 |
unsigned short | 2 | 2 | 2 | 0 ~ 65535 |
int | 2 | 4 | 4 | -2147483648~2157483647 |
unsigned int | 2 | 4 | 4 | 0~4294967295 |
long int / long | 4 | 4 | 8 | -2147483648~2147483647 |
unsigned long | 4 | 4 | 8 | 0~42294967295 |
long long int / long long | 8 | 8 | 8 |
-9223372036854775808 |
double | 8 | 8 | 8 | |
float | 4 | 4 | 4 | |
long double | 10/12 | 10/16 | 有效位10字节。32位为了对齐实际分配12字节;64位分配16字节 | |
指针 | 2 | 4 | 8 |