教育>本科研究生>计算机类
C程序设计基础(英文版)  

C程序设计基础(英文版)  "

作者:汪芳等
ISBN:9787121459771
定价:¥69.8
字数:496千字
页数:276
出版时间:2023-07
开本:16开
版次:01-01
装帧:
出版社:电子工业出版社
简介

编程技术是信息技术中最重要的技能和工具之一,它是连接信息和计算机的桥梁。掌握并熟练使用编程语言已成为所有大学生必备的技能。 C语言是高级编程语言的先驱,也是最重要和最流行的语言之一。本书的目标是引导初学者进入程序设计的殿堂,内容涉及编程基础知识包括运算符和表达式、数据输入和输出、选择结构、循环结构、数组、函数、指针、结构体、链表和文件读写等。主要侧重于C语言的基本语法和编程的基本技能。我们将通过大量简洁的程序示例指导您构建编程思维并编写程序。本书旨在帮助学生掌握C语言编程技能,并为其他课程奠定基础,如C++、数学建模、操作系统、计算机图形学、系统仿真等。本书既可以作为大学本科计算机专业和非计算机专业的程序设计基础课程教材,也可以用作大专院校授课教材,亦是一本不可多得的自学教材。

前言

Programming is one of the most important skills and tools in information technology. It is a bridge to connect information and computers. Mastering and skillfully using a programming language have become a necessary skill for all college students. C is the pioneer of advanced programming languages and is still one of the most important and popular languages. The objective of our course is to try to make C programming simple for beginners. This course involves programming basis, operator and expression, data input and output, selection structure, loop structure, implementation of modular programming, expression, and processing of complex data, function, pointer, file reading, writing, etc. It mainly focuses on the fundamental grammar of C language and the main principles of programming. This course is expected to help students master skills of programming in C and construct a foundation for other courses, such as C++, mathematical modeling, operating systems, computer graphics, system simulation, etc. Our authors are associate professors from NPU, Fang Wang, Xiuwei Zhang, Ying Wei, and Feifei Xue. They have taught programming for more than ten years and they are very experienced and full of enthusiasm. We will guide you to build the programming thinking and construct your programs with a large number of concise program examples. Due to the lack of time, mistakes are inevitable. Thank you for your support! Email: wangf@nwpu.edu.cn

目录

Contents Chapter 1 Introducing C 1 1.1 Why programming is important 1 1.2 Why C 2 1.3 History of C 3 1.4 Strengths and Weaknesses of C 4 1.5 How to learn C? 6 1.5.1 Code::Blocks 6 1.5.2 XCODE 13 1.5.3 online compiler 16 1.5.4 How to sign in to ICOURSE (MOOC) and XUETANG 17 1.5.5 Can’t find GNU GCC Compiler 20 1.5.6 I can’t debug 21 quiz 1. 23 Chapter 2 Data Types and Expressions 24 2.1 The General Form of a Simple Program 24 2.2.1 The General Form 27 2.2.2 Variables and Assignment 31 2.2 Character set and Keywords 33 2.2.1 Character set 33 2.2.2 Keywords 34 2.2.3 Identifiers 34 2.3 Data Types 35 2.3.1 integer types 37 2.3.2 floating types 38 2.3.3 Character types 39 2.3.4 void type 41 2.3.5 Variables 42 2.4 Constants and Variables 45 2.4.1 Constants 45 2.5 Operators and Expressions 50 2.5.1 Arithmetic Operators 52 2.5.2 Assignment Operators 54 2.5.3 Increment and Decrement Operators 57 2.5.4 The sizeof Operator 58 2.5.5 The Comma Operator 59 2.5.6 The conditional operator 59 2.5.7 Bitwise Operators 60 2.5.8 Expression Statement 61 2.5.9 Type Conversion 61 quiz 2. 63 Chapter 3 Program control structure 64 3.1 Statement 64 3.2 Input and output 65 3.2.1 Single Character Input/output 66 3.2.2 Formatted Input and Output 68 3.2 The scanf Function 83 3.3 The sequence structure 92 3.4 The selection structure 95 3.4.1 Relational Expressions 97 3.4.2 Logical Expressions 99 3.4.3 The if Statement 102 3.4.5 The switch Statement 112 3.5 The loop structure 119 3.5.1 While loop 120 3.5.2 do while loop 124 3.5.3 for loop 129 3.5.4 Exiting from a Loop 133 Quiz 3 137 Chapter 4 The Preprocessor 141 4.1 Preprocessor Directives 141 4.2 Macro Definitions 142 4.3 File Inclusion 145 Quiz 4 146 Answer 4 146 Chapter 5 Arrays 147 5.1 One-Dimensional Arrays 147 5.1.1 The declaration of a one-dimensional array 147 5.1.2 Access array elements 149 5.1.3 Index 150 5.1.4 Initialization 151 5.1.5 Variable-Length Arrays 152 5.2 Multidimensional Arrays 152 5.2.1 Declaration of a two-dimensional array 152 5.2.2 Variable-Length 2D arrays 154 5.2.3 Initializing a 2D Array 157 5.2.4 Application of the 2D Array 157 Quiz 5. 158 Answer 158 Chapter 6 Functions 160 6.1 Introduction 160 6.2 Defining and Calling Functions 162 6.3 Arguments 168 6.4 The return Statement 170 6.5 Declaration 175 6.6 Array arguments 176 6.7 Recursion 179 6.8 Sort algorithm 180 6.9 Program Organization 188 6.9.1 Scope 188 6.9.2 Local variables and Global variables 189 Quiz 6 195 Answer 196 Chapter 7 Pointers 197 7.1 Pointer Variables 197 7.2 The Address and Indirection Operators 198 7.3 Pointers as Arguments 199 7.4 Pointers as Return Values 201 7.5 Using Pointers for Array 201 7.6 Array Arguments 204 7.9 Pointers and Multidimensional Arrays 205 7.10 Pointers to Functions 207 Quiz 7 208 Answer 209 Chapter 8 Strings 210 8.1 String Constants and Variables 210 8.1.1 String Constants 210 8.1.2 String Variables 211 8.2 Reading and Writing Strings 212 8.2.1 Writing Strings 212 8.2.2 Reading Strings 213 8.3 Accessing the Characters in a String 214 8.4 Using the C String Library 215 8.4.1 strcpy and strncpy 215 8.4.2 strlen 216 8.4.3 strcat and strncat 216 8.4.4 strcmp 217 8.5 sprintf and sscanf 218 8.6 Array of Strings 219 8.7 Array of Pointers to Strings 220 Quiz 8. 221 Answer 222 Chapter 9 Structures, Unions, and Enumerations 223 9.1 Structure Variables 223 9.1.1 Structure Variables 223 9.1.2 Structures as Arguments and Return Values 228 9.1.3 Arrays of Structures 230 9.1.4 Pointers to structs 231 9.2 Unions 231 9.3 Enumerations 233 Quiz 9 234 Answer 236 Chapter 10 LinkedList 237 10.1 Introduction 237 10.3 creating a linked list 239 10.4 Insert a node 242 10.5 Search a node 245 10.6 delete a node 245 Chapter 11 Files 247 11.1 Streams 247 11.2 File Operations 248 11.2.1 Opening a file 249 11.2.2 Closing a file 251 11.2.3 remove and rename functions 251 11.2.4 Detecting End-of-File and Error Conditions 252 11.3 Input/Output operation on File 253 11.3.1 Character Input/Output Functions 253 11.3.2 Line Input/Output Functions 255 11.3.3 Formatted Input/Output Functions 257 11.3.4 Block Input/Output Functions 259 11.4 File Position 260 Quiz 11 261 Answer 11 261

作者简介

编辑推荐

作者寄语

电子资料

www.luweidong.cn

下一个