常见的数据类型及所占字节
char 字符型 1字节
short 短整型 2字节
long 长整型 4字节
long 长长整型 8字节
int 整型 4字节
float 单精度浮点型 4字节
double 双精度浮点型 8字节
输出数据类型所占内存空间
printf("%d\n", sizeof(int));
printf("%d\n", sizeof(short));
printf("%d\n", sizeof(long));
printf("%d\n", sizeof(long long));
printf("%d\n", sizeof(char));
printf("%d\n", sizeof(float));
printf("%d\n", sizeof(double));
sizeof () 计算类型或变量所占空间大小(单位:字节)