文章目录
前言
我们在学c语言的时候,要用到许多关键字定义,而关键字,是不能创建的,原本就有的,那有那些呢?#define定义的宏又是怎样的呢?4000多字没有废话带你详细了解
一、关键字(32个)
auto break case char
const continue default do
double else enum extern
float for goto if
int long register return
short signed sizeof static
struct switch typedef union
unsigned void volatile while
1.关键字分类
补充一个点:变量命名规则如下:
2、关键字 typedef(类型重命名)
在我们类型中有比较长的的名字,一般写起来比较麻烦
如: unsigned int (无符号整型),这个如果经常写到就会有点麻烦,
我们可以给他改个名字,让我们好写一点,随便给他改个名字 ht,
这时我们就可以用到 typedef 关键字,注意:typedef只能对类型重命名
写法如下:
#include<stdio.h>
//将unsigned int改名成ht
typedef unsigned int ht;
int main()
{
//ht此时就是无符号整型 unsigned int
//与 unsigned int num1 = 1; 意思一样
ht num1 = 1;
//输出<