#include int main()
{
/**********************************************************
// 我们列出的是VS2008的内存占用情况
// 一、整型变量的分类:
// 1,基本整型,以int表示
// 2,短整型,以short int表示,或以short表示
// 3,长整型,以long int表示,或以long表示
// 加上修饰符unsigned,可以分为6种
// 1,[signed] int,4字节
// 2,unsigned int,4字节
// 3,[signed] short [int],2字节,-32768-32767
// 4,unsigned short [int],2字节,0-65535
// 5,long [int],4字节
// 6,unsigned long [int],4字节
// 二、浮点型变量的分类
// 1,单精度float型,4字节
// 2,双精度double型,8字节
// 3,长双精度long double型,8字节
// 三、字符型数据,在内存中占一个字节(任何系统都是)
//1,char,1个字节,-128-127
//2,unsigned char,1个字节,0-256
/***********************************************************/
printf("整型变量:\n");
printf("size of int is: %d\n",sizeof(int));
printf("size of unsigned int is: %d\n",sizeof(unsigned int));
printf("size of short is: %d\n",sizeof(short));
printf("size of unsigned short is: %d\n",sizeof(unsigned short));
printf("size of long is: %d\n",sizeof(long));
printf("size of unsigned long is: %d\n",sizeof(unsigned long));
printf("---------------\n");
printf("浮点型变量:\n");
printf("size of float is: %d\n",sizeof(float));
printf("size of double is: %d\n",sizeof(double));
printf("size of long double is: %d\n",sizeof(long double));
printf("---------------\n");
printf("字符型变量:\n");
printf("size of char is: %d\n",sizeof(char));
printf("size of unsigned char is: %d\n",sizeof(unsigned char));
return 0;
}