一个简单的c语言代码,可以查看各种数据类型字节长度,int,long,short,char,long long,float,double类型。
# include <stdio.h> int main(){ printf("%d\n",sizeof(char)); printf("%d\n",sizeof(short)); printf("%d\n",sizeof(int)); printf("%d\n",sizeof(long)); printf("%d\n",sizeof(long long)); printf("%d\n",sizeof(float)); printf("%d\n",sizeof(double)); printf("%d\n",sizeof(short int)); return 0; }