热门搜索: 中考 高考 考试 开卷17
服务电话 024-96192/23945006
 

CPrimerPlus第6版英文版上下册

编号:
9787115413512001
销售价:
¥102.78
(市场价: ¥129.90)
赠送积分:
103
商品介绍

本书共十七章,第一章和第二章介绍了C语言编程的预备知识。第三-十五章详细讲解了C语言的相关知识,包括数据类型、格式化输入/输出、运算符、表达式等;第十六章和十七章介绍C预处理器、C库和高级文件输入输出等。

1 Getting Ready 1

第 1章 初识C语言

Whence C / C语言的起源 1

Why C / 选择C语言的理由 2

Design Features / 设计特性 2

Efficiency / 高效性 3

Portability / 可移植性 3

Power and Flexibility / 强大而灵活 3

Programmer Oriented / 面向程序员 3

Shortcomings / 缺点 4

Whither C / C语言的应用范围 4

What Computers Do / 计算机能做什么 5

High-level Computer Languages and Compilers / 高 级计算机语言和编译器 6

Language Standards / 语言标准 7

The First ANSI/ISO C Standard / 第 1个ANSI/ISO C标准 8

The C99 Standard / C99标准 8

The C11 Standard / C11标准 9

Using C: Seven Steps / 使用C语言的几个步骤 9

Step 1: Define the Program Objectives / 第 1步:定义程序的目标 10

Step 2: Design the Program / 第 2步:设计程序 10

Step 3: Write the Code / 第3步:编写代码 11

Step 4: Compile / 第4步:编译 11

Step 5: Run the Program / 第5步:运行程序 12

Step 6: Test and Debug the Program / 第6步:测试和调试程序 12

Step 7: Maintain and Modify the Program / 第7步:维护和修改代码 13

Commentary / 说明 13

Programming Mechanics / 编程机制 13

Object Code Files, Executable Files, and Libraries / 目标代码文件、可执行文件和库 14

Unix System / Unix系统 16

The GNU Compiler Collection and the LLVM Project / GNU编译器集合和LLVM项目 18

Linux Systems / Linux系统 18

Command-Line Compilers for the PC / PC的命令行编译器 19

Integrated Development Environments (Windows) / 集成开发环境(Windows) 19

The Windows/Linux Option / Windows/Linux 21

C on the Macintosh / Macintosh中的C 21

How This Book Is Organized / 本书的组织结构 22

Conventions Used in This Book / 本书的约定 22

Typeface / 字体 22

Program Output / 程序输出 23

Spe Elements / 特殊元素 24

Summary / 本章小结 24

Review Questions / 复习题 25

Programming Exercise / 编程练习 25

2 Introducing C 27

第 2章 C语言概述

A Simple Example of C / 简单的C程序示例 27

The Example Explained / 示例解释 28

Pass 1: Quick Synopsis / 第 1遍:快速概要 30

Pass 2: Program Details / 第 2遍:程序细节 31

The Structure of a Simple Program / 简单程序的结构 40

Tips on Making Your Programs Readable / 提高程序可读性的技巧 41

Taking Another Step in Using C / 进一步使用C 42

Documentation / 程序说明 43

Multiple Declarations / 多条声明 43

Multiplication / 乘法 43

Printing Multiple Values / 打印多个值 43

While You're at It—Multiple Functions / 多个函数 44

Introducing Debugging / 调试程序 46

Syntax Errors / 语法错误 46

Semantic Errors / 语义错误 47

Program State / 程序状态 49

Keywords and Reserved Identifiers / 关键字和保留标识符 49

Key Concepts / 关键概念 50

Summary / 本章小结 51

Review Questions / 复习题 51

Programming Exercises / 编程练习 53

3 Data and C 55

第3章 数据和C

A Sample Program / 示例程序 55

What's New in This Program / 程序中的新元素 57

Data Variables and Constants / 变量与常量数据 59

Data: Data-Type Keywords / 数据:数据类型关键字 59

Integer Versus Floating-Point Types / 整数和浮点数 60

The Integer / 整数 61

The Floating-Point Number / 浮点数 61

Basic C Data Types / C语言基本数据类型 62

The int Type / int类型 62

Other Integer Types / 其他整数类型 66

Using Characters: Type char / 使用字符:char类型 71

The _Bool Type / _Bool类型 77

Portable Types: stdint.h and inttypes.h / 可移植类型:stdint.h和inttypes.h 77

Types float, double, and long double / float、double和long double 79

Complex and Imaginary Types / 复数和虚数类型 85

Beyond the Basic Types / 其他类型 85

Type Sizes / 类型大小 87

Using Data Types / 使用数据类型 88

Arguments and Pitfalls / 参数和陷阱 89

One More Example: Escape Sequences / 转义序列示例 91

What Happens When the Program Runs / 程序运行情况 91

Flushing the Output / 刷新输出 92

Key Concepts / 关键概念 93

Summary / 本章小结 93

Review Questions / 复习题 94

Programming Exercises / 编程练习 97

4 Character Strings and Formatted Input/Output 99

第4章 字符串和格式化输入/输出

Introductory Program / 前导程序 99

Character Strings: An Introduction / 字符串简介 101

Type char Arrays and the Null Character / char类型数组和字符 101

Using Strings / 使用字符串 102

The strlen() Function / strlen()函数 103

Constants and the C Preprocessor / 常量和C预处理器 106

The const Modifier / const限定符 109

Manifest Constants on the Job / 明示常量 109

Exploring and Exploiting printf() and scanf() / printf()和scanf() 112

The printf() Function / printf()函数 112

Using printf() / 使用printf() 113

Conversion Specification Modifiers for printf() / printf()的转换说明修饰符 115

What Does a Conversion Specification Convert / 转换说明的意义 122

Using scanf() / 使用scanf() 128

The * Modifier with printf() and scanf() / printf()和scanf()的*修饰符 133

Usage Tips for printf() / printf()的用法提示 135

Key Concepts / 关键概念 136

Summary / 本章小结 137

Review Questions / 复习题 138

Programming Exercises / 编程练习 140

5 Operators, Expressions, and Statements 143

第5章 运算符、表达式和语句

Introducing Loops / 循环简介 144

Fundamental Operators / 基本运算符 146

Assignment Operator: = / 赋值运算符:= 146

Addition Operator: + / 加法运算符:+ 149

Subtraction Operator: - / 减法运算符:- 149

Sign Operators: - and + / 符号运算符:-和+ 150

Multiplication Operator: * / 乘法运算符:* 151

Division Operator: / / 除法运算符:/ 153

Operator Precedence / 运算符优先级 154

Precedence and the Order of Evaluation / 优先级和求值顺序 156

Some Additional Operators / 其他运算符 157

The sizeof Operator and the size_t Type / sizeof运算符和size_t类型 158

Modulus Operator: % / 求模运算符:% 159

Increment and Decrement Operators: ++ and -- / 递增和递减运算符:++和-- 160

Decrementing: -- / 递减运算符:-- 164

Precedence / 优先级 165

Don't Be Too Clever / 不要自作聪明 166

Expressions and Statements / 表达式和语句 167

Expressions / 表达式 167

Statements / 语句 168

Compound Statements (Blocks) / 复合语句(块) 171

Type Conversions / 类型转换 174

The Cast Operator / 强制类型转换运算符 176

Function with Arguments / 带参数的函数 177

A Sample Program / 示例程序 180

Key Concepts / 关键概念 182

Summary / 本章小结 182

Review Questions / 复习题 183

Programming Exercises / 编程练习 187

6 C Control Statements: Looping 189

第6章 C控制语句:循环

Revisiting the while Loop / 再探while循环 190

Program Comments / 程序注释 191

C-Style Reading Loop / C风格读取循环 192

The while Statement / while语句 193

Terminating a while Loop / 终止while循环 194

When a Loop Terminates / 何时终止循环 194

while: An Entry-Condition Loop / while:入口条件循环 195

Syntax Points / 语法要点 195

Which Is Bigger: Using Relational Operators and Expressions / 用关系运算符和表达式比较大小 197

What Is Truth / 什么是真 199

What Else Is True / 其他真值 200

Troubles with Truth / 真值的问题 201

The New _Bool Type / 新的_Bool类型 203

Precedence of Relational Operators / 优先级和关系运算符 205

Indefinite Loops and Counting Loops / 不确定循环和计数循环 207

The for Loop / for循环 208

Using for for Flexibility / 利用for的灵活性 210

More Assignment Operators: +=, -=, *=, /=, %= / 其他赋值运算符:+=、-=、*=、/=、%= 215

The Comma Operator / 逗号运算符 215

Zeno Meets the for Loop / 当Zeno遇到for循环 218

An Exit-Condition Loop: do while / 出口条件循环:do while 220

Which Loop / 如何选择循环 223

Nested Loops / 嵌套循环 224

Program Discussion / 程序分析 225

A Nested Variation / 嵌套变式 225

Introducing Arrays / 数组简介 226

Using a for Loop with an Array / 在for循环中使用数组 228

A Loop Example Using a Function Return Value / 使用函数返回值的循环示例 230

Program Discussion / 程序分析 232

Using Functions with Return Values / 使用带返回值的函数 233

Key Concepts / 关键概念 234

Summary / 本章小结 235

Review Questions / 复习题 236

Programming Exercises / 编程练习 241

7 C Control Statements: Branching and Jumps 245

第7章 C控制语句:分支和跳转

The if Statement / if语句 246

Adding else to the if Statement / if else语句 248

Another Example: Introducing getchar() and putchar() / 另一个示例:介绍getchar()和putchar() 250

The ctype.h Family of Character Functions / ctype.h系列的字符函数 252

Multiple Choice else if / 多重选择else if 254

Pairing else with if / else与if配对 257

More Nested ifs / 多层嵌套的if语句 259

Let's Get Logical / 逻辑运算符 263

Alternate Spellings: The iso646.h Header File / 备选拼写:iso646.h头文件 265

Precedence / 优先级 265

Order of Evaluation / 求值顺序 266

Ranges / 范围 267

A Word-Count Program / 一个统计单词的程序 268

The Conditional Operator: : / 条件运算符: : 271

Loop Aids: continue and break / 循环辅助:continue和break 274

The continue Statement / continue语句 274

The break Statement / break语句 277

Multiple Choice: switch and break / 多重选择:switch和break 280

Using the switch Statement / switch语句 281

Reading Only the First Character of a Line / 只读每行的首字符 283

Multiple Labels / 多重标签 284

switch and if else / switch和if else 286

The goto Statement / goto语句 287

Avoiding goto / 避免使用goto 287

Key Concepts / 关键概念 291

Summary / 本章小结 291

Review Questions / 复习题 292

Programming Exercises / 编程练习 296

8 Character Input/Output and Input Validation 299

第8章 字符输入/输出和输入验证

Single-Character I/O: getchar() and putchar()

/ 单字符I/O:getchar()和putchar() 300

Buffers / 缓冲区 301

Terminating Keyboard Input / 结束键盘输入 302

Files, Streams, and Keyboard Input / 文件、流和键盘输入 303

The End of File / 文件结尾 304

Redirection and Files / 重定向和文件 307

Unix, Linux, and Windows Command Prompt Redirection / Unix、Linux和DOS重定向 307

Creating a Friendlier User Interface / 创建更友好的用户界面 312

Working with Buffered Input / 使用缓冲输入 312

Mixing Numeric and Character Input / 混合数值和字符输入 314

Input Validation / 输入验证 317

Analyzing the Program / 分析程序 322

The Input Stream and Numbers / 输入流和数字 323

Menu Browsing / 菜单浏览 324

Tasks / 任务 324

Toward a Smoother Execution / 使执行更顺利 325

Mixing Character and Numeric Input / 混合字符和数值输入 327

Key Concepts / 关键概念 330

Summary / 本章小结 331

Review Questions / 复习题 331

Programming Exercises / 编程练习 332

9 Functions 335

第9章 函数

Reviewing Functions / 复习函数 335

Creating and Using a Simple Function / 创建并使用简单函数 337

Analyzing the Program / 分析程序 338

Function Arguments / 函数参数 340

Defining a Function with an Argument: Formal Parameters / 定义带形式参数的函数 342

Prototyping a Function with Arguments / 声明带形式参数函数的原型 343

Calling a Function with an Argument: Actual Arguments / 调用带实际参数的函数 343

The Black-Box Viewpoint / 黑盒视角 345

Returning a Value from a Function with return / 使用return从函数中返回值 345

Function Types / 函数类型 348

ANSI C Function Prototyping / ANSI C函数原型 349

The Problem / 问题所在 350

The ANSI C Solution / ANSI的解决方案 351

No Arguments and Unspecified Arguments / 无参数和未指定参数 352

Hooray for Prototypes / 函数原型的优点 353

Recursion / 递归 353

Recursion Revealed / 演示递归 354

Recursion Fundamentals / 递归的基本原理 355

Tail Recursion / 尾递归 356

Recursion and Reversal / 递归和倒序计算 358

Recursion Pros and Cons / 递归的优缺点 360

Compiling Programs with Two or More Source Code Files

/ 编译多源代码文件的程序 361

Unix / Unix 362

Linux / Linux 362

DOS Command-Line Compilers / DOS命令行编译器 362

Windows and Apple IDE Compilers / Windows和苹果的IDE编译器 362

Using Header Files / 使用头文件 363

Finding Addresses: The & Operator / 查找地址:&运算符 367

Altering Variables in the Calling Function / 更改主调函数中的变量 369

Pointers: A First Look / 指针简介 371

The Indirection Operator: * / 间接运算符:* 371

Declaring Pointers / 声明指针 372

Using Pointers to Communicate Between Functions / 使用指针在函数间通信 373

Key Concepts / 关键概念 378

Summary / 本章小结 378

Review Questions / 复习题 379

Programming Exercises / 编程练习 380

10 Arrays and Pointers 383

第 10章 数组和指针

Arrays / 数组 383

Initialization / 初始化数组 384

Designated Initializers (C99) / 指定初始化器(C99) 388

Assigning Array Values / 给数组元素赋值 390

Array Bounds / 数组边界 390

Specifying an Array Size / 指定数组的大小 392

Multidimensional Arrays / 多维数组 393

Initializing a Two-Dimensional Array / 初始化二维数组 397

More Dimensions / 其他多维数组 398

Pointers and Arrays / 指针和数组 398

Functions, Arrays, and Pointers / 函数、数组和指针 401

Using Pointer Parameters / 使用指针形参 404

Comment: Pointers and Arrays / 指针表示法和数组表示法 407

Pointer Operations / 指针操作 407

Protecting Array Contents / 保护数组中的数据 412

Using const with Formal Parameters / 对形式参数使用const 413

More About const / const的其他内容 415

Pointers and Multidimensional Arrays / 指针和多维数组 417

Pointers to Multidimensional Arrays / 指向多维数组的指针 420

Pointer Compatibility / 指针的兼容性 421

Functions and Multidimensional Arrays / 函数和多维数组 423

Variable-Length Arrays (VLAs) / 变长数组(VLA) 427

Compound Literals / 复合字面量 431

Key Concepts / 关键概念 434

Summary / 本章小结 435

Review Questions / 复习题 436

Programming Exercises / 编程练习 439

11 Character Strings and String Functions 441

第 11章 字符串和字符串函数

Representing Strings and String I/O / 表示字符串和字符串I/O 441

Defining Strings Within a Program / 在程序中定义字符串 442

Pointers and Strings / 指针和字符串 451

String Input / 字符串输入 453

Creating Space / 分配空间 453

The Unfortunate gets() Function / 不幸的gets()函数 453

The Alternatives to gets() / gets()的替代品 455

The scanf() Function / scanf()函数 462

String Output / 字符串输出 464

The puts() Function / puts()函数 464

The fputs() Function / fputs()函数 465

The printf() Function / printf()函数 466

The Do-It-Yourself Option / 自定义输入/输出函数 466

String Functions / 字符串函数 469

The strlen() Function / strlen()函数 469

The strcat() Function / strcat()函数 471

The strncat() Function / strncat()函数 473

The strcmp() Function / strcmp()函数 475

The strcpy() and strncpy() Functions / strcpy()和strncpy()函数 482

The sprintf() Function / sprintf()函数 487

Other String Functions / 其他字符串函数 489

A String Example: Sorting Strings / 字符串示例:字符串排序 491

Sorting Pointers Instead of Strings / 排序指针而非字符串 493

The Selection Sort Algorithm / 选择排序算法 494

The ctype.h Character Functions and Strings / ctype.h字符函数和字符串 495

Command-Line Arguments / 命令行参数 497

Command-Line Arguments in Integrated Environments / 集成环境中的命令行参数 500

Command-Line Arguments with the Macintosh / Macintosh中的命令行参数 500

String-to-Number Conversions / 把字符串转换为数字 500

Key Concepts / 关键概念 504

Summary / 本章小结 504

Review Questions / 复习题 505

Programming Exercises / 编程练习 508

12 Storage Classes, Linkage, and Memory Management 511

第 12章 存储类别、链接和内存管理

Storage Classes / 存储类别 511

Scope / 作用域 513

Linkage / 链接 515

Storage Duration / 存储期 516

Automatic Variables / 自动变量 518

Register Variables / 寄存器变量 522

Static Variables with Block Scope / 块作用域的静态变量 522

Static Variables with External Linkage / 外部链接的静态变量 524

Static Variables with Internal Linkage / 内部链接的静态变量 529

Multiple Files / 多文件 530

Storage-Class Specifier Roundup / 存储类别说明符 530

Storage Classes and Functions / 存储类别和函

Stephen Prata,在美国加州肯特菲尔得的马林学院教授天文、物理和计算机科学。他毕业于加州理工学院,在美国加州大学伯克利分校获得博士学位。他单独编写以及与他人合作编写的编程图书有十多本,其中包括C++Primer Plus和C Primer Plus,而且后者获得了计算机出版协会1990年度How—to计算机图书奖。

商品参数
基本信息
品牌/出版社 无版别
ISBN 9787115413512
条码 9787115413512
编者 1
译者 --
出版年月 2021.11
开本 16开
装帧
页数 1004
字数 1194
版次 1
印次
纸张 一般胶版纸
商品评论

暂无商品评论信息 [发表商品评论]

商品咨询

暂无商品咨询信息 [发表商品咨询]