Chapter One Introduction to C(引言)\t1
1.1 Brief history of C(C 语言简史)\t1
1.2 Why programmers use C(为什么程序员爱用C语言)\t1
1.2.1 C is portable\t1
1.2.2 C is a structured programming language\t2
1.2.3 C is efficient\t2
1.2.4 C is flexible\t2
1.2.5 C is powerful\t2
1.2.6 C is concise\t3
1.3 Developing a C program(开发C 程序)\t3
1.4 Suggestions for learning C programming(学习C 语言程序设计的建议)\t4
Chapter Two C Data Types(C数据类型)\t6
2.1 Constants(常量)\t6
2.2 Variables(变量)\t6
2.3 Simple output to the screen(简单的屏幕输出)\t8
2.4 Comments(注释)\t9
2.5 Data types(数据类型)\t10
2.5.1 Short integer data types\t10
2.5.2 Long integer data types\t11
2.5.3 Unsigned integer data types\t11
2.5.4 Double floating-point data type\t11
2.6 Data type sizes(数据类型的大小)\t11
Programming pitfalls\t13
Quick syntax reference\t13
Exercises\t14
Chapter Three Simple Arithmetic Operations and Expressions(简单的算术运算和表达式)\t16
3.1 C operators(C 运算符)\t16
3.1.1 The assignment operator\t16
3.1.2 Arithmetic operators\t17
3.1.3 Increment and decrement operators\t19
3.1.4 Combined operators\t21
3.2 Operator precedence(运算符优先级)\t22
3.3 Type conversions and casts(类型转换与强制类型转换)\t24
Programming pitfalls\t26
Quick syntax reference\t27
Exercises\t27
Chapter Four Keyboard Input and Screen Output(键盘输入和屏幕输出)\t30
4.1 Simple keyboard input(简单的键盘输入)\t30
4.2 Using a width and precision specification in printf()
[在函数printf( )中使用域宽和精度说明]\t31
4.3 Single-character input and output(单个字符的输入和输出)\t33
Programming pitfalls\t35
Quick syntax reference\t35
Exercises\t36
Chapter Five Control Statements: if and switch(控制语句:if 和switch)\t38
5.1 The if statement(if 语句)\t38
5.2 The if-else statement(if-else 语句)\t39
5.3 Logical operators(逻辑运算符)\t41
5.4 Nested if statements(嵌套的if 语句)\t42
5.5 The switch statement(switch 语句)\t44
5.6 The conditional operator :(条件运算符)\t46
Programming pitfalls\t47
Quick syntax reference\t48
Exercises\t48
Chapter Six Iterative Control Statements: while, do-while, and for
(循环控制语句:while、do-while和for)\t51
6.1 The while statement(while 语句)\t51
6.2 The do-while loop(do-while 循环)\t52
6.3 The for statement(for 语句)\t54
6.4 Nested loops(嵌套的循环)\t56
Programming pitfalls\t58
Quick syntax reference\t59
Exercises\t59
Chapter Seven Arrays(数组)\t61
7.1 Introduction to arrays(引言)\t61
7.2 Initialising arrays(数组初始化)\t66
7.3 Two-dimensional arrays(二维数组)\t67
7.4 Initialising two-dimensional arrays(二维数组的初始化)\t68
7.5 Multi-dimensional arrays(多维数组)\t69
Programming pitfalls\t70
Quick syntax reference\t70
Exercises\t70
Chapter Eight Pointers(指针)\t73
8.1 Variable addresses(变量的地址)\t73
8.2 Pointer variables(指针变量)\t74
8.3 The dereference operator *(解引用运算符*)\t75
8.4 Why use pointers (为什么使用指针)\t76
Programming pitfalls\t77
Quick syntax reference\t77
Exercises\t77
Chapter Nine Pointers and Arrays(指针和数组)\t79
9.1 Pointers and one-dimensional arrays(指针和一维数组)\t79
9.2 Pointers and multi-dimensional arrays(指针和多维数组)\t81
9.3 Dynamic memory allocation(动态内存分配)\t82
9.3.1 The malloc() function\t82
9.3.2 The calloc() function\t85
9.3.3 The realloc() function\t86
9.3.4 Allocating memory for multi-dimensional arrays\t87
Programming pitfalls\t90
Quick syntax reference\t90
Exercises\t90
Chapter Ten Strings(字符串)\t93
10.1 String literals(字符串)\t93
10.2 Long character strings(长字符串)\t94
10.3 Strings and arrays(字符串和数组)\t94
10.4 Displaying a string(显示一个字符串)\t95
10.5 The puts() function[puts( )函数]\t97
10.6 The gets() function[gets( )函数]\t98
10.7 Accessing individual characters of a string(访问字符串中的单个字符)\t99
10.8 Assigning a string to a pointer (用字符串为字符指针赋值)\t100
10.9 String functions(字符串处理函数)\t101
10.9.1 Finding the length of a string\t101
10.9.2 Copying a string\t102
10.9.3 String concatenation\t102
10.9.4 Comparing strings\t102
10.9.5 Other string functions\t103
10.10 Converting numeric strings to numbers (数值字符串向数值的转换)\t103
10.11 Arrays of strings(字符串数组)\t105
Programming pitfalls\t108
Quick syntax reference\t109
Exercises\t109
Chapter Eleven Functions(函数)\t112
11.1 Introduction(引言)\t112
11.2 Function arguments(函数参数)\t114
11.3 Returning a value from a function (从函数返回一个值)\t116
11.4 Passing arguments by value (按值传参)\t118
11.5 Passing arguments by reference(按引用传参)\t119
11.6 Changing arguments in a function (在函数中改变实参的值)\t120
11.7 Passing a one-dimensional array to a function (向函数传递一维数组)\t121
11.8 Passing a multi-dimensional array to a function (向函数传递多维数组)\t123
11.9 Storage classes(变量的存储类型)\t124
11.9.1 auto\t124
11.9.2 static\t125
11.9.3 extern\t126
11.9.4 register\t128
11.10 Command line arguments (命令行参数)\t128
11.11 Mathematical functions(数学函数)\t130
11.11.1 Some commonly used trigonometric functions\t130
11.11.2 Other common mathematical functions\t131
11.11.3 Pseudo-random number functions\t132
11.11.4 Some time-related functions\t132
11.12 Recursion\t133
Programming pitfalls\t136
Quick syntax reference\t137
Exercises\t137
Chapter Twelve Structures(结构体)\t141
12.1 Defining a structure(定义结构体)\t141
12.2 Pointers to structures(结构体指针)\t144
12.3 Initialising a structure variable (结构体变量的初始化)\t145
12.4 Passing a structure to a function (向函数传递结构体变量)\t147
12.5 Nested structures(嵌套的结构体)\t149
12.6 Including a structure template from a file (从文件中引用结构体模板)\t150
12.7 The typedef statement (typedef 语句)\t151
12.8 Arrays of structures(结构体数组)\t152
12.9 Enumerated data types(枚举数据类型)\t158
Programming pitfalls\t160
Quick syntax reference\t161
Exercises\t162
Chapter Thirteen File Input and Output(文件的输入和输出)\t165
13.1 Binary and ASCII (text) files [二进制文件和ASCII(文本)文件]\t165
13.2 Opening and closing files (文件的打开和关闭)\t166
13.3 Reading a character from a file using fgetc()
[使用函数fgetc( )从文件中读字符]\t168
13.4 Writing a character to a file using fputc()
[使用函数fputc( )向文件中写字符]\t170
13.5 Reading a string of characters from a file using fgets()
[使用函数fgets( )从文件中读字符串]\t171
13.6 Writing a string of characters to a file using fputs()
[使用函数fputs( )向文件中写字符串]\t172
13.7 Formatted input-output to a file using fscanf() and fprintf()\t173
[使用函数fscanf( )和fprintf( )进行文件的格式化读写]\t173
13.8 The standard files(标准文件)\t174
13.9 Block input-output using fread() and fwrite()\t175
[使用函数fread( )和fwrite( )进行块读写]\t175
13.10 Rewinding a file using rewind()[使用函数rewind( )对文件重定位]\t177
13.11 Random access of files using fseek() [使用函数fseek( )随机访问文件]\t179
13.12 Finding the position in a file using ftell()
[使用函数ftell( )查找文件的当前位置]\t184
13.13 Deleting a file using remove()[使用函数remove( )删除文件]\t184
Programming pitfalls\t185
Quick syntax reference\t186
Exercises\t187
Chapter Fourteen The C Preprocessor(C编译预处理)\t190
14.1 Including files(包含文件)\t190
14.2 Defining macros(定义宏)\t191
14.3 Macro parameters(带参数的宏)\t192
14.4 Macros and functions(宏和函数)\t194
14.5 Some useful macros(一些有用的宏)\t195
14.6 Conditional directive