目录
1.C 语言基础知识 ............................................................................................................................4
1.1 什么是 C 语言? ................................................................................................................4
1.2 第一个 C 语言程序 ............................................................................................................5
1.2.1 写第一个代码的工具和步骤..................................................................................5
1.2.2 第一段代码要用到的基础知识..............................................................................7
1.3 scanf()函数 .................................................................................................................9
2. 数据类型 ...................................................................................................................................11
2.1 内置数据类型 ..................................................................................................................11
2.2 操作符 sizeof ....................................................................................................................11
2.3 类型的使用: ..................................................................................................................12
3.变量、常量 .................................................................................................................................13
3.1 定义变量的方法 ..............................................................................................................13
3.2 变量的命名 ......................................................................................................................13
3.3 变量的分类 ......................................................................................................................13
3.4 变量的使用 ......................................................................................................................14
3.5 变量的作用域和生命周期...............................................................................................14
3.5.1 作用域 ...................................................................................................................14
3.5.2 生命周期 ...............................................................................................................15
3.6 常量 ..................................................................................................................................15
4.字符串+转义字符+注释..............................................................................................................16
4.1 字符串 ..............................................................................................................................16
4.2 转义字符 ..........................................................................................................................16
4.3 strlen 函数 ........................................................................................................................19
5.注释 .............................................................................................................................................19
6.选择语句 .....................................................................................................................................20
7.循环语句 .....................................................................................................................................21
8.函数 .............................................................................................................................................22
9.数组 .............................................................................................................................................25
9.1 数组定义 ..........................................................................................................................25
9.2 数组的下标 .....................................................................................................................25
9.3 数组的使用 ......................................................................................................................25
10.操作符 .......................................................................................................................................26
10.1 算术操作符 ....................................................................................................................26
10.2 移位操作符 ....................................................................................................................26
10.3 位操作符 ........................................................................................................................26
10.4 赋值操作符 ....................................................................................................................26
10.5 单目操作符 ....................................................................................................................26
10.6 关系操作符 ....................................................................................................................29
10.7 逻辑操作符 ....................................................................................................................29
10.8 条件操作符 ....................................................................................................................29
10.9 逗号表达式 ....................................................................................................................30
10.10 下标引用、函数调用和结构成员...............................................................................30