C语言之基础知识----防备忘
#include<stdio.h>
int main()
{
printf(" 测试系统:WIN10 64位版本\n");
printf(" VC++6.0中个数据类型占用内存字节大小\n");
printf("char=%d\n",sizeof(char));
printf("short=%d\n",sizeof(short));
printf("int=%d\n",sizeof(int));
printf("long=%d\n",sizeof(long));
// printf("%d\n",sizeof(long long)); //VC++不支持long long型
printf("_int64=%d\n",sizeof(_int64)); //需用_int64代替
printf("float=%d\n",sizeof(float));
printf("double=%d\n",sizeof(double));
printf("long double=%d\n",sizeof(long double)); //结果不做解释
}
测试结果: