数据类型
char //字符数据类型
例:
#include <stdio.h>
int main() //main前面int(决定返回值类型)表示main函数调用后返回一个整型值
{
char ch= 'A'; //此处必须为''否则代码无法执行
printf(" % c\n",ch); //此处必须为""否则代码无法执行,%c-->char
return 0; //返回0;此处语法上(实际上一般为0)不必为0,整型即可
}
short //短整型
int //整型
例:
#include <stdio.h>
int main()
{
int age= 19;
printf(" % d\n",age); //%d-->int(10进制)
return 0;
}
long //长整型
long long //更长的长整型
float //单精度浮点型
例:
#include <stdio.h>
int main()
{
float age= 19.10;
printf(" % f\n",age); //%f-->float
return 0;
}
double //双精度浮点型
各数据类型大小
计算机单位
bit - 比特位 ---->> 一