1. 数据类型
//数据类型
printf("%zu \t 打印字符%c \n",sizeof(char),'x' );//字符数据类型 占用1个字节
printf("%zu\t 打印短整型%d \n" ,sizeof(short),1); //短整型 2
printf("%zu\t 打印整形%d \n",sizeof(int),123); //整形 4
printf("%zu\t 打印长整型%d \n",sizeof(long),132323232); //长整型 8
printf("%zu\t 打印更长的整形%d \n",sizeof(long long),123344444); //更长的整形 8
printf("%zu\t 打印浮点型%.2f \n",sizeof(float),3.1); //单精度浮点数 4
printf("%zu\t 打印浮点型%lf \n",sizeof(double),3.1415); //双精度浮点数 8
printf("打印字符串%s \n","xxdss");
2. 常量
//1.const
const float pai = 3.13;
// pai = 3.14; //const修饰不可修改
//2.define
#define Max 150
printf("最大值 %d\n",Max);
3.字符串
//字符串的结束符为\0,"hello world"中末尾自动加的\0
char arr1[] = "hello";
char arr2[] = {'h','e','l','l','o'};
char arr3[] = {'h','e','l','l','o','\0'};
printf("%s\n",arr2);
printf("%s\n",arr1);
printf("%s\n",arr3);
4.转义字符