//字符类型
char ch = 'a';
//整形
int age = 20;
//短整型
short num = 10;
//long -长整型
//long long -更长的整型
//单精度浮点型
float weight = 55.5;
//双精度浮点型
double d = 0.0;
sizeof的单位 -字节byte
int main() {
printf("hehe\n");
printf("比特\n");
printf("%d\n",100);//打印一个整数
//sizeof -关键字- 操作符-计算机类型或者变量所占空间的大小
printf("%d\n", sizeof(char)); //1
printf("%d\n", sizeof(int)); //2
printf("%d\n", sizeof(short)); //4
printf("%d\n", sizeof(long)); //4
printf("%d\n", sizeof(long long));//8
printf("%d\n", sizeof(float));//4
printf("%d\n", sizeof(double));//8
return 0;
}
c语言标准:sizeof(long)>=sizeof(int)
计算机中的单位:
bit-比特位
byte-字节=8bit
kb-1024byte
mb-1024kb
gb-1024mb
tb=1024gb
pb=1024tb
计算机中的二进制:0 1
八进制:0-7
10 进制数字的组成: 0-9