由于C語言中的關鍵字是由英文單詞構成,因此它非常有利于運用雙語講授或英語講授。本書為國內高校進行C語言雙語或英語教學提供實用教材。第1章介紹C語言編程的基本知識和樣例,第2章講解C語言基本概念和基本規范,第3章講解運算符和表達式,第4章講解選擇操作和循環操作,第5章講解數組,輔以其在查詢和排序方面的應用,第6章講解字符串和指針,第7章講解函數,第8章講解結構體和共同體,第9章講解文件處理。各章節按照由淺入深、由實例至抽象概念再到具體應用的理念進行排序。本書的作者長年使用英語作為工作語言,多年從事C語言一線教學工作,長期運用C語言進行科研開發。本書沉淀了作者在C語言方面的長期教學和科研經驗,為讀者提供有效的C語言知識梳理,引導讀者形成完備且實用的C語言知識體系。
1 Introduction to Programming and C
1.1 Introdution
1.2 Introdution to programming languages
1.3 Introduction to C
1.4 Writing the first C program
1.5 Compiling and running C programs
1.6 Running C programs online
1.7 Running C programs in Microsoft Visual C++
1.8 Running C programs in Code::Blocks IDE
1.9 Writing the first C++ program in CodeBlocks IDE
1.10 Review questions
2 C Programming Basis
2.1 Introduction
2.2 Variables and identifiers
2.3 Keywords
2.4 Data types
2.5 Formatted input and output
2.6 Literals and constants
2.7 Type casting
2.8 Review questions
3 Operators and Expressions
3.1 Introduction
3.2 Relational and equality operators
3.3 Arithmetic operators
3.4 Bitwise operators
3.5 Assignment operators
3.6 Increment and decrement operators
3.7 Logical operators
3.8 Conditional operator
3.9 Special operators
3.10 Operator precedence and associativity
3.11 Review questions
4 Branching and Looping
4.1 Introduction
4.2 The if statement
4.3 The if-else statement
4.4 The if-else-if statement
4.5 Nested if-else statement
4.6 The switch statement
4.7 The ternary operator
4.8 The gore and labels
4.9 The while loop
4.10 The do-while loop
4.11 The for loop
4.12 Nesting of loops
4.13 The break statement
4.14 The continue statement
4.15 Review questions
5 Arrays
5.1 Introduction
5.2 One-dimensional arrays
5.3 Multi-dimensional arrays
5.4 Searching methods
5.5 Linear search
5.6 Binary search
5.7 Sorting methods
5.8 Insertion sort
5.9 Selection sort
5.10 Bubble sort
5.11 Applications of two-dimensional arrays
5.12 Review questions
6 Strings and Pointers
6.1 Introduction
6.2 String library functions
6.3 Array of strings
6.4 Sorting characters and strings
6.5 Introduction to pointers
6.6 Pointer to pointer
6.7 Pointers and arrays
6.8 Array of pointers
6.9 Review questions
7 Functions
7.1 Introduction
7.2 Defining a function
7.3 Arguments and parameters
7.4 Scope of function variables
7.5 Static variables
7.6 Functions and pointers
7.7 Recursive functions
7.8 Built-in functions
7.9 Review questions
8 Structures and Unions
8.1 Introduction
8.2 Defining structures
8.3 Initializing structures
8.4 Accessing structure members
8.5 Using typedef keyword
8.6 Nested structures
8.7 Structures containing arrays
8.8 Arrays of structures
8.9 Structures and pointers
8.10 Structures and linked list
8.11 Structures and functions
8.12 Unions
8.13 Review questions
9 File Handling
9.1 Introduction
9.2 File operations
9.3 Data files using structures
9.4 Deleting a file
9.5 Copying and merging files
9.6 Review questions
Appendix A List of header files and standard library functions
Appendix B Sample programming exercises
Appendix C Model question paper and answers
Appendix D Decimal-binary-octal-hex-ASCII conversion chart
Appendix E Bibliography
Appendix F English-Chinese Vocabulary List
About the authors