暫無商品咨詢信息 [發表商品咨詢]
本書共十七章,第一章和第二章介紹了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 |
| 印次 | |
| 紙張 | 一般膠版紙 |
暫無商品評論信息 [發表商品評論]
暫無商品咨詢信息 [發表商品咨詢]