1
2
3
4
5
6
7
8
9
10
#include <stdio.h>
intmain(void)
{
printf("char 所占字节数 %d\n", sizeof(char));
printf("int 所占字节数 %d\n", sizeof(int));
printf("short 所占字节数 %d\n", sizeof(short));
printf("long 所占字节数 %d\n", sizeof(long));
printf("float 所占字节数 %d\n", sizeof(float));
printf("double 所占字节数 %d\n", sizeof(double));
}