了解代码,了解字节
#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));
return 0;
}
输出结果
1
2
4
4
8
4
8
了解每种类型语言所占字节可以更好的学习c语言。更好的定位所用语言类型。