2
目录
第 1 章 C 语言程序的基本形式 .................................................................................................. 4
1.1 C
语言的结构
.......................................................................................................................... 4
1.2
标识符
.................................................................................................................................... 4
1.3
保留字
(
即关键字
) ................................................................................................................. 5
1.4
基本数据类型
........................................................................................................................... 5
1.5
算术表达式
................................................................................................................................ 7
1.6 C
语言的基本语句
.................................................................................................................. 7
第 2 章 流程控制 ......................................................................................................................... 11
2.1
控制表达式
............................................................................................................................. 11
2.2 for
循环语句
............................................................................................................................ 12
2.3 while
语句
............................................................................................................................ 13
2.4 Do- while
语句
..................................................................................................................... 15
2.5 if
语
句
................................................................................................................................ 15
2.6
条件表达式运算符
............................................................................................................. 19
2.7 break
语句
............................................................................................................................... 19
2.8 continue
语句
....................................................................................................................... 20
2.9 switch
语句
.............................................................................................................................. 20
第 3 章 数组与字符串 ................................................................................................................. 22
3.1
一维数组
............................................................................................................................. 22
3.2
多维数组
............................................................................................................................. 23
3.3
数组元素初始化
................................................................................................................. 24
3.4
字符串
................................................................................................................................. 25
3.5
字符串函数
......................................................................................................................... 27
3.6
字符函数和字符转换及运算
.............................................................................................. 27
第 4 章 函数与变量 ..................................................................................................................... 29
4.1 C
程序设计的一般形式
....................................................................................................... 29
4.2
函数
......................................................................................................................................... 30
4.3
函数返回值
.......................................................................................................................... 32
4.4
函数的调用
......................................................................................................................... 33
4.5
递归函数与递归调用
............................................................................................................. 34
4.6
外部函数和内部函数
(
了解
) .................................................................................................. 34
4.7
变量的存储类型
..................................................................................................................... 35
第 5 章 指针 ................................................................................................................................. 41
5.1
指针和地址
.............................................................................................................................. 41
5.2
指针变量和指针运算符
.......................................................................................................... 41
5.3
指针与函数参数
................................................................................................................. 45
5.4
指针、数组和字符串指针
................................................................................................. 46
5.5
指针数组
............................................................................................................................. 49
5.6
多级指针
................................................................................................................................. 51
5.7
返回指针的函数
..................................................................................................................... 52
5.8
函数指针
............................................................................................................................. 53
第 6 章 结构体 .............................................................................................................................. 54