双语版C程序设计 / 国外计算机科学教材系列
作者: P.凯利
出版时间:2013年3月
出版社:电子工业出版社
- 电子工业出版社
- 9787121190438
- 1-1
- 39183
- 0047151162-6
- 平装
- 16开
- 2013年3月
- 499
- 240
- 工学
- 软件工程
- TP312C
- 编程语言
- 本科
《双语版C程序设计》可作为高等学校计算机相关专业或软件学院的c程序设计双语教材,也可供程序员和编程爱好者参考使用。
Chapter One Introduction to C(引言) 1
1.1 Brief history of C(C语言简史) 1
1.2 Why programmers use C(为什么程序员爱用C语言) 1
1.2.1 C is portable 1
1.2.2 C is a structured programming language 2
1.2.3 C is efficient 2
1.2.4 C is flexible 2
1.2.5 C is powerful 3
1.2.6 C is concise 3
1.3 Developing a C program(开发C程序) 3
1.4 Suggestions for learning C Programming(学习C语言程序设计的建议) 5
Chapter Two C Data Types(C数据类型) 6
2.1 Constants(常量) 6
2.2 Variables(变量) 6
2.3 Simple output to the screen(简单的屏幕输出) 8
2.4 Comments(注释) 9
2.5 Data types(数据类型) 10
2.5.1 Short integer data types 11
2.5.2 Long integer data types 11
2.5.3 Unsigned integer data types 11
2.5.4 Double floating-point data type 12
2.6 Data type sizes(数据类型的大小) 12
Programming pitfalls 14
Quick syntax reference 15
Exercises 15
Chapter Three Simple Arithmetic Operations and Expressions(简单的算术运算和表达式) 17
3.1 C operators(C运算符) 17
3.1.1 The assignment operator 17
3.1.2 Arithmetic operators 18
3.1.3 Increment and decrement operators 20
3.1.4 Combined operators 23
3.2 Operator precedence(运算符优先级) 24
3.3 Type conversions and casts(类型转换与强制类型转换) 26
Programming pitfalls 28
Quick syntax reference 29
Exercises 29
Chapter Four Keyboard Input and Screen Output(键盘输入和屏幕输出) 32
4.1 Simple keyboard input(简单的键盘输入) 32
4.2 Using a width and precision specification in printf( )
[在函数printf( )中使用域宽和精度说明] 34
4.3 Single-character input and output(单个字符的输入和输出) 35
Programming pitfalls 37
Quick syntax reference 38
Exercises 38
Chapter Five Control Statements: If and Switch(控制语句:if和switch) 40
5.1 The if statement(if语句) 40
5.2 The if-else statement(if-else语句) 41
5.3 Logical operators(逻辑运算符) 43
5.4 Nested if statements(嵌套的if语句) 44
5.5 The switch statement(switch语句) 46
5.6 The conditional operator ?:(条件运算符) 48
Programming pitfalls 50
Quick syntax reference 51
Exercises 52
Chapter Six Iterative Control Statements: while, do-while, and for
(循环控制语句:while、do-while和for) 54
6.1 The while statement(while语句) 54
6.2 The do-while loop(do-while循环) 56
6.3 The for statement(for语句) 57
6.4 Nested loops(嵌套的循环) 59
Programming pitfalls 62
Quick syntax reference 63
Exercises 63
Chapter Seven Arrays(数组) 65
7.1 Introduction to arrays(引言) 65
7.2 Initialising arrays(数组初始化) 71
7.3 Two-dimensional arrays(二维数组) 72
7.4 Initialising two-dimensional arrays(二维数组的初始化) 74
7.5 Multi-dimensional arrays(多维数组) 75
Programming pitfalls 76
Quick syntax reference 76
Exercises 77
Chapter Eight Pointers(指针) 79
8.1 Variable addresses(变量的地址) 79
8.2 Pointer variables(指针变量) 80
8.3 The dereference operator *(解引用运算符*) 81
8.4 Why use pointers? (为什么使用指针) 82
Programming pitfalls 83
Quick syntax reference 83
Exercises 83
Chapter Nine Pointers and Arrays(指针和数组) 85
9.1 Pointers and one-dimensional arrays(指针和一维数组) 85
9.2 Pointers and multi-dimensional arrays(指针和多维数组) 87
9.3 Dynamic memory allocation(动态内存分配) 89
9.3.1 The malloc() function 89
9.3.2 The calloc() function 92
9.3.3 The realloc() function 93
9.3.4 Allocating memory for multi-dimensional arrays 95
Programming pitfalls 98
Exercises 99
Chapter Ten Strings(字符串) 101
10.1 String literals(字符串) 101
10.2 Long character strings(长字符串) 102
10.3 Strings and arrays(字符串和数组) 103
10.4 Displaying a string(显示一个字符串) 104
10.5 The puts() function[puts( )函数] 105
10.6 The gets() function[gets( )函数] 106
10.7 Accessing individual characters of a string(访问字符串中的单个字符) 107
10.8 Assigning a string to a pointer(用字符串为字符指针赋值) 108
10.9 String functions(字符串处理函数) 110
10.9.1 Finding the length of a string 110
10.9.2 Copying a string 110
10.9.3 String concatenation 111
10.9.4 Comparing strings 111
10.9.5 Other string functions 112
10.10 Converting numeric strings to numbers(数值字符串向数值的转换) 113
10.11 Arrays of strings(字符串数组) 114
Programming pitfalls 117
Quick syntax reference 118
Exercises 119
Chapter Eleven