File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ C 关键字
2
+ ===
3
+
4
+ C 语言一共有32个关键字,如下表所示:
5
+
6
+ 关键字 | 说明 | 关键字 | 说明
7
+ ---- | ---- | ---- | ----
8
+ auto | 声明自动变量 | static | 声明静态变量
9
+ short | 声明短整型变量或函数 | volatile | 说明变量在程序执行中可被隐含地改变
10
+ [ int] ( ./c_variables.md ) | 声明整型变量或函数 | void | 声明函数无返回值或无参数,声明无类型指针
11
+ long | 声明长整型变量或函数 | [ if] ( ./c_conditions.md ) | 条件语句
12
+ [ float] ( ./c_variables.md ) | 声明浮点型变量或函数 | [ else] ( ./c_conditions.md ) | 条件语句否定分支(与 if 连用)
13
+ double | 声明双精度变量或函数 | [ switch] ( ./c_switch.md ) | 用于开关语句
14
+ [ char] ( ./c_strings.md ) | 声明字符型变量或函数 | case | 开关语句分支
15
+ [ struct] ( ./c_structs.md ) | 声明结构体变量或函数 | [ for] ( ./c_for_loop.md ) | 一种循环语句
16
+ union | 声明共用数据类型 | do | 循环语句的循环体
17
+ [ enum] ( ./c_enum.md ) | 声明枚举类型 | [ while] ( ./c_while_loop.md ) | 循环语句的循环条件
18
+ typedef | 用以给数据类型取别名 | goto | 无条件跳转语句
19
+ [ const] ( ./c_constants.md ) | 声明只读变量 | [ continue] ( ./c_break_continue.md ) | 结束当前循环,开始下一轮循环
20
+ unsigned | 声明无符号类型变量或函数 | [ break] ( ./c_break_continue.md ) | 跳出当前循环
21
+ signed | 声明有符号类型变量或函数 | default | 开关语句中的“其他”分支
22
+ extern | 声明变量是在其他文件正声明 | sizeof | 计算数据类型长度
23
+ register | 声明寄存器变量 | return | 子程序返回语句(可以带参数,也可不带参数)循环条件
Original file line number Diff line number Diff line change @@ -100,12 +100,14 @@ int main() {
100
100
return 0;
101
101
}
102
102
```
103
+ <!-- rehype:style= background: #ff000036;-->
103
104
104
105
会出现错误:
105
106
106
107
``` bash
107
108
prog.c:12:15: error: assignment to expression with array type
108
109
```
110
+ <!-- rehype:style= background: #ff000036;-->
109
111
110
112
但是,有一个解决方案! 您可以使用 ` strcpy() ` 函数并将值分配给 ` s1.myString ` ,如下所示:
111
113
Original file line number Diff line number Diff line change 36
36
- / : 结构
37
37
- c_structs.md : C 结构 Structures
38
38
39
+ - / : 参考
40
+ - c_keywords.md : C 关键字 Keywords
41
+
You can’t perform that action at this time.
0 commit comments