使用运算符sizeof(对象或类),显示各数据类型(char,int,short,long,float,double)所占的内存字节数。“对象”可以是某个常量或变量,“类型”可以是某个数据类型,比如“int”普通整数类型。printf("\n%d\n",sizeof(int));