编辑推荐

  经久不衰的C语言畅销经典教程  针对C11标准进行全面更新  上一版累计销量逾22万册  C语言领域的作品
  《C Primer Plus(第6版 英文版 套装上下册)》是一本经过仔细测试、精心设计的完整C语言教程,它涵盖了C语言编程中的核心内容。《C Primer Plus(第6版 英文版 套装上下册)》作为计算机科学的经典著作,讲解了包含结构化代码和自顶向下设计在内的程序设计原则。  与以前的版本一样,作者的目标仍旧是为读者提供一本入门型、条理清晰、见解深刻的C语言教程。作者把基础的编程概念与C语言的细节很好地融合在一起,并通过大量短小精悍的示例同时演示一两个概念,通过学以致用的方式鼓励读者掌握新的主题。  每章末尾的复习题和编程练习题进一步强化了重要的信息,有助于读者消化那些难以理解的概念。《C Primer Plus(第6版 英文版 套装上下册)》采用了友好、易于使用的编排方式,不仅适合打算认真学习C语言编程的学生阅读,也适合那些精通其他编程语言,但希望更好地掌握C语言这门核心语言的开发人员阅读。  《C Primer Plus(第6版 英文版 套装上下册)》在之前版本的基础之上进行了全新升级,它涵盖了C语言新的进展以及C11标准的详细内容。《C Primer Plus(第6版 英文版 套装上下册)》还提供了大量深度与广度齐备的教学技术和工具,来提高你的学习。  《C Primer Plus(第6版 英文版 套装上下册)》包含如下内容:  详细完整地讨论了C语言的基础特性和附加特性;  清晰解释了使用C语言不同部分的时机,以及原因;  通过简洁、简单的示例加强读者的动手练习,以帮助一次理解一两个概念;  囊括了数百个实用的代码示例;  每章末尾的复习题和编程练习可以检测你的理解情况。  涵盖了C泛型编程,以提供大的灵活性。

内容简介

  《CPrimerPlus(第6版)英文版》详细讲解了C语言的基本概念和编程技巧。  《CPrimerPlus(第6版)英文版》共17章。第1、2章介绍了C语言编程的预备知识。第3~15章详细讲解了C语言的相关知识,包括数据类型、格式化输入/输出、运算符、表达式、语句、循环、字符输入和输出、函数、数组和指针、字符和字符串函数、内存管理、文件输入输出、结构、位操作等。第16章、17章介绍C预处理器、C库和高级数据表示。《C Primer Plus(第6版 英文版 套装上下册)》以完整的程序为例,讲解C语言的知识要点和注意事项。每章末设计了大量复习题和编程练习,帮助读者巩固所学知识和提高实际编程能力。附录给出了各章复习题的参考答案和丰富的参考资料。  《CPrimerPlus(第6版)英文版》可作为C语言的教材,适用于需要系统学习C语言的初学者,也适用于巩固C语言知识或希望进一步提高编程技术的程序员。

作者简介

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

目录

1GettingReady 1
第1章初识C语言
WhenceC?/C语言的起源 1
WhyC?/选择C语言的理由 2
DesignFeatures/设计特性 2
Efficiency/高效性 3
Portability/可移植性 3
PowerandFlexibility/强大而灵活 3
ProgrammerOriented/面向程序员 3
Shortcomings/缺点 4
WhitherC?/C语言的应用范围 4
WhatComputersDo/计算机能做什么 5
High-levelComputerLanguagesandCompilers/高级计算机语言和编译器 6
LanguageStandards/语言标准 7
TheFirstANSI/ISOCStandard/第1个ANSI/ISOC标准 8
TheC99Standard/C99标准 8
TheC11Standard/C11标准 9
UsingC:SevenSteps/使用C语言的几个步骤 9
Step1:DefinetheProgramObjectives/第1步:定义程序的目标 10
Step2:DesigntheProgram/第2步:设计程序 10
Step3:WritetheCode/第3步:编写代码 11
Step4:Compile/第4步:编译 11
Step5:RuntheProgram/第5步:运行程序 12
Step6:TestandDebugtheProgram/第6步:测试和调试程序 12
Step7:MaintainandModifytheProgram/第7步:维护和修改代码 13
Commentary/说明 13
ProgrammingMechanics/编程机制 13
ObjectCodeFiles,ExecutableFiles,andLibraries/目标代码文件、可执行文件和库 14
UnixSystem/Unix系统 16
TheGNUCompilerCollectionandtheLLVMProject/GNU编译器集合和LLVM项目 18
LinuxSystems/Linux系统 18
Command-LineCompilersforthePC/PC的命令行编译器 19
IntegratedDevelopmentEnvironments(Windows)/集成开发环境(Windows) 19
TheWindows/LinuxOption/Windows/Linux 21
ContheMacintosh/Macintosh中的C 21
HowThisBookIsOrganized/《C Primer Plus(第6版 英文版 套装上下册)》的组织结构 22
ConventionsUsedinThisBook/《C Primer Plus(第6版 英文版 套装上下册)》的约定 22
Typeface/字体 22
ProgramOutput/程序输出 23
SpecialElements/特殊元素 24
Summary/本章小结 24
ReviewQuestions/复习题 25
ProgrammingExercise/编程练习 25
2IntroducingC 27
第2章C语言概述
ASimpleExampleofC/简单的C程序示例 27
TheExampleExplained/示例解释 28
Pass1:QuickSynopsis/第1遍:快速概要 30
Pass2:ProgramDetails/第2遍:程序细节 31
TheStructureofaSimpleProgram/简单程序的结构 40
TipsonMakingYourProgramsReadable/提高程序可读性的技巧 41
TakingAnotherStepinUsingC/进一步使用C 42
Documentation/程序说明 43
MultipleDeclarations/多条声明 43
Multiplication/乘法 43
PrintingMultipleValues/打印多个值 43
WhileYou’reatIt—MultipleFunctions/多个函数 44
IntroducingDebugging/调试程序 46
SyntaxErrors/语法错误 46
SemanticErrors/语义错误 47
ProgramState/程序状态 49
KeywordsandReservedIdentifiers/关键字和保留标识符 49
KeyConcepts/关键概念 50
Summary/本章小结 51
ReviewQuestions/复习题 51
ProgrammingExercises/编程练习 53
3DataandC 55
第3章数据和C
ASampleProgram/示例程序 55
What’sNewinThisProgram?/程序中的新元素 57
DataVariablesandConstants/变量与常量数据 59
Data:Data-TypeKeywords/数据:数据类型关键字 59
IntegerVersusFloating-PointTypes/整数和浮点数 60
TheInteger/整数 61
TheFloating-PointNumber/浮点数 61
BasicCDataTypes/C语言基本数据类型 62
TheintType/int类型 62
OtherIntegerTypes/其他整数类型 66
UsingCharacters:Typechar/使用字符:char类型 71
The_BoolType/_Bool类型 77
PortableTypes:stdint.handinttypes.h/可移植类型:stdint.h和inttypes.h 77
Typesfloat,double,andlongdouble/float、double和longdouble 79
ComplexandImaginaryTypes/复数和虚数类型 85
BeyondtheBasicTypes/其他类型 85
TypeSizes/类型大小 87
UsingDataTypes/使用数据类型 88
ArgumentsandPitfalls/参数和陷阱 89
OneMoreExample:EscapeSequences/转义序列示例 91
WhatHappensWhentheProgramRuns/程序运行情况 91
FlushingtheOutput/刷新输出 92
KeyConcepts/关键概念 93
Summary/本章小结 93
ReviewQuestions/复习题 94
ProgrammingExercises/编程练习 97
4CharacterStringsandFormattedInput/Output 99
第4章字符串和格式化输入/输出
IntroductoryProgram/前导程序 99
CharacterStrings:AnIntroduction/字符串简介 101
TypecharArraysandtheNullCharacter/char类型数组和null字符 101
UsingStrings/使用字符串 102
Thestrlen()Function/strlen()函数 103
ConstantsandtheCPreprocessor/常量和C预处理器 106
TheconstModifier/const限定符 109
ManifestConstantsontheJob/明示常量 109
ExploringandExploitingprintf()andscanf()/printf()和scanf() 112
Theprintf()Function/printf()函数 112
Usingprintf()/使用printf() 113
ConversionSpecificationModifiersforprintf()/printf()的转换说明修饰符 115
WhatDoesaConversionSpecificationConvert?/转换说明的意义 122
Usingscanf()/使用scanf() 128
The*Modifierwithprintf()andscanf()/printf()和scanf()的*修饰符 133
UsageTipsforprintf()/printf()的用法提示 135
KeyConcepts/关键概念 136
Summary/本章小结 137
ReviewQuestions/复习题 138
ProgrammingExercises/编程练习 140
5Operators,Expressions,andStatements 143
第5章运算符、表达式和语句
IntroducingLoops/循环简介 144
FundamentalOperators/基本运算符 146
AssignmentOperator:=/赋值运算符:= 146
AdditionOperator:+/加法运算符:+ 149
SubtractionOperator:-/减法运算符:- 149
SignOperators:-and+/符号运算符:-和+ 150
MultiplicationOperator:*/乘法运算符:* 151
DivisionOperator://除法运算符:/ 153
OperatorPrecedence/运算符优先级 154
PrecedenceandtheOrderofEvaluation/优先级和求值顺序 156
SomeAdditionalOperators/其他运算符 157
ThesizeofOperatorandthesize_tType/sizeof运算符和size_t类型 158
ModulusOperator:%/求模运算符:% 159
IncrementandDecrementOperators:++and--/递增和递减运算符:++和-- 160
Decrementing:--/递减运算符:-- 164
Precedence/优先级 165
Don’tBeTooClever/不要自作聪明 166
ExpressionsandStatements/表达式和语句 167
Expressions/表达式 167
Statements/语句 168
CompoundStatements(Blocks)/复合语句(块) 171
TypeConversions/类型转换 174
TheCastOperator/强制类型转换运算符 176
FunctionwithArguments/带参数的函数 177
ASampleProgram/示例程序 180
KeyConcepts/关键概念 182
Summary/本章小结 182
ReviewQuestions/复习题 183
ProgrammingExercises/编程练习 187
6CControlStatements:Looping 189
第6章C控制语句:循环
RevisitingthewhileLoop/再探while循环 190
ProgramComments/程序注释 191
C-StyleReadingLoop/C风格读取循环 192
ThewhileStatement/while语句 193
TerminatingawhileLoop/终止while循环 194
WhenaLoopTerminates/何时终止循环 194
while:AnEntry-ConditionLoop/while:入口条件循环 195
SyntaxPoints/语法要点 195
WhichIsBigger:UsingRelationalOperatorsandExpressions/用关系运算符和表达式比较大小 197
WhatIsTruth?/什么是真 199
WhatElseIsTrue?/其他真值 200
TroubleswithTruth/真值的问题 201
TheNew_BoolType/新的_Bool类型 203
PrecedenceofRelationalOperators/优先级和关系运算符 205
IndefiniteLoopsandCountingLoops/不确定循环和计数循环 207
TheforLoop/for循环 208
UsingforforFlexibility/利用for的灵活性 210
MoreAssignmentOperators:+=,-=,*=,/=,%=/其他赋值运算符:+=、-=、*=、/=、%= 215
TheCommaOperator/逗号运算符 215
ZenoMeetstheforLoop/当Zeno遇到for循环 218
AnExit-ConditionLoop:dowhile/出口条件循环:dowhile 220
WhichLoop?/如何选择循环 223
NestedLoops/嵌套循环 224
ProgramDiscussion/程序分析 225
ANestedVariation/嵌套变式 225
IntroducingArrays/数组简介 226
UsingaforLoopwithanArray/在for循环中使用数组 228
ALoopExampleUsingaFunctionReturnValue/使用函数返回值的循环示例 230
ProgramDiscussion/程序分析 232
UsingFunctionswithReturnValues/使用带返回值的函数 233
KeyConcepts/关键概念 234
Summary/本章小结 235
ReviewQuestions/复习题 236
ProgrammingExercises/编程练习 241
7CControlStatements:BranchingandJumps 245
第7章C控制语句:分支和跳转
TheifStatement/if语句 246
AddingelsetotheifStatement/ifelse语句 248
AnotherExample:Introducinggetchar()andputchar()/另一个示例:介绍getchar()和putchar() 250
Thectype.hFamilyofCharacterFunctions/ctype.h系列的字符函数 252
MultipleChoiceelseif/多重选择elseif 254
Pairingelsewithif/else与if配对 257
MoreNestedifs/多层嵌套的if语句 259
Let’sGetLogical/逻辑运算符 263
AlternateSpellings:Theiso646.hHeaderFile/备选拼写:iso646.h头文件 265
Precedence/优先级 265
OrderofEvaluation/求值顺序 266
Ranges/范围 267
AWord-CountProgram/一个统计单词的程序 268
TheConditionalOperator:?:/条件运算符:?: 271
LoopAids:continueandbreak/循环辅助:continue和break 274
ThecontinueStatement/continue语句 274
ThebreakStatement/break语句 277
MultipleChoice:switchandbreak/多重选择:switch和break 280
UsingtheswitchStatement/switch语句 281
ReadingOnlytheFirstCharacterofaLine/只读每行的首字符 283
MultipleLabels/多重标签 284
switchandifelse/switch和ifelse 286
ThegotoStatement/goto语句 287
Avoidinggoto/避免使用goto 287
KeyConcepts/关键概念 291
Summary/本章小结 291
ReviewQuestions/复习题 292
ProgrammingExercises/编程练习 296
8CharacterInput/OutputandInputValidation 299
第8章字符输入/输出和输入验证
Single-CharacterI/O:getchar()andputchar()
/单字符I/O:getchar()和putchar() 300
Buffers/缓冲区 301
TerminatingKeyboardInput/结束键盘输入 302
Files,Streams,andKeyboardInput/文件、流和键盘输入 303
TheEndofFile/文件结尾 304
RedirectionandFiles/重定向和文件 307
Unix,Linux,andWindowsCommandPromptRedirection/Unix、Linux和DOS重定向 307
CreatingaFriendlierUserInterface/创建更友好的用户界面 312
WorkingwithBufferedInput/使用缓冲输入 312
MixingNumericandCharacterInput/混合数值和字符输入 314
InputValidation/输入验证 317
AnalyzingtheProgram/分析程序 322
TheInputStreamandNumbers/输入流和数字 323
MenuBrowsing/菜单浏览 324
Tasks/任务 324
TowardaSmootherExecution/使执行更顺利 325
MixingCharacterandNumericInput/混合字符和数值输入 327
KeyConcepts/关键概念 330
Summary/本章小结 331
ReviewQuestions/复习题 331
ProgrammingExercises/编程练习 332
9Functions 335
第9章函数
ReviewingFunctions/复习函数 335
CreatingandUsingaSimpleFunction/创建并使用简单函数 337
AnalyzingtheProgram/分析程序 338
FunctionArguments/函数参数 340
DefiningaFunctionwithanArgument:FormalParameters/定义带形式参数的函数 342
PrototypingaFunctionwithArguments/声明带形式参数函数的原型 343
CallingaFunctionwithanArgument:ActualArguments/调用带实际参数的函数 343
TheBlack-BoxViewpoint/黑盒视角 345
ReturningaValuefromaFunctionwithreturn/使用return从函数中返回值 345
FunctionTypes/函数类型 348
ANSICFunctionPrototyping/ANSIC函数原型 349
TheProblem/问题所在 350
TheANSICSolution/ANSI的解决方案 351
NoArgumentsandUnspecifiedArguments/无参数和未指定参数 352
HoorayforPrototypes/函数原型的优点 353
Recursion/递归 353
RecursionRevealed/演示递归 354
RecursionFundamentals/递归的基本原理 355
TailRecursion/尾递归 356
RecursionandReversal/递归和倒序计算 358
RecursionProsandCons/递归的优缺点 360
CompilingProgramswithTwoorMoreSourceCodeFiles
/编译多源代码文件的程序 361
Unix/Unix 362
Linux/Linux 362
DOSCommand-LineCompilers/DOS命令行编译器 362
WindowsandAppleIDECompilers/Windows和苹果的IDE编译器 362
UsingHeaderFiles/使用头文件 363
FindingAddresses:The&Operator/查找地址:&运算符 367
AlteringVariablesintheCallingFunction/更改主调函数中的变量 369
Pointers:AFirstLook/指针简介 371
TheIndirectionOperator:*/间接运算符:* 371
DeclaringPointers/声明指针 372
UsingPointerstoCommunicateBetweenFunctions/使用指针在函数间通信 373
KeyConcepts/关键概念 378
Summary/本章小结 378
ReviewQuestions/复习题 379
ProgrammingExercises/编程练习 380
10ArraysandPointers 383
第10章数组和指针
Arrays/数组 383
Initialization/初始化数组 384
DesignatedInitializers(C99)/指定初始化器(C99) 388
AssigningArrayValues/给数组元素赋值 390
ArrayBounds/数组边界 390
SpecifyinganArraySize/指定数组的大小 392
MultidimensionalArrays/多维数组 393
InitializingaTwo-DimensionalArray/初始化二维数组 397
MoreDimensions/其他多维数组 398
PointersandArrays/指针和数组 398
Functions,Arrays,andPointers/函数、数组和指针 401
UsingPointerParameters/使用指针形参 404
Comment:PointersandArrays/指针表示法和数组表示法 407
PointerOperations/指针操作 407
ProtectingArrayContents/保护数组中的数据 412
UsingconstwithFormalParameters/对形式参数使用const 413
MoreAboutconst/const的其他内容 415
PointersandMultidimensionalArrays/指针和多维数组 417
PointerstoMultidimensionalArrays/指向多维数组的指针 420
PointerCompatibility/指针的兼容性 421
FunctionsandMultidimensionalArrays/函数和多维数组 423
Variable-LengthArrays(VLAs)/变长数组(VLA) 427
CompoundLiterals/复合字面量 431
KeyConcepts/关键概念 434
Summary/本章小结 435
ReviewQuestions/复习题 436
ProgrammingExercises/编程练习 439
11CharacterStringsandStringFunctions 441
第11章字符串和字符串函数
RepresentingStringsandStringI/O/表示字符串和字符串I/O 441
DefiningStringsWithinaProgram/在程序中定义字符串 442
PointersandStrings/指针和字符串 451
StringInput/字符串输入 453
CreatingSpace/分配空间 453
TheUnfortunategets()Function/不幸的gets()函数 453
TheAlternativestogets()/gets()的替代品 455
Thescanf()Function/scanf()函数 462
StringOutput/字符串输出 464
Theputs()Function/puts()函数 464
Thefputs()Function/fputs()函数 465
Theprintf()Function/printf()函数 466
TheDo-It-YourselfOption/自定义输入/输出函数 466
StringFunctions/字符串函数 469
Thestrlen()Function/strlen()函数 469
Thestrcat()Function/strcat()函数 471
Thestrncat()Function/strncat()函数 473
Thestrcmp()Function/strcmp()函数 475
Thestrcpy()andstrncpy()Functions/strcpy()和strncpy()函数 482
Thesprintf()Function/sprintf()函数 487
OtherStringFunctions/其他字符串函数 489
AStringExample:SortingStrings/字符串示例:字符串排序 491
SortingPointersInsteadofStrings/排序指针而非字符串 493
TheSelectionSortAlgorithm/选择排序算法 494
Thectype.hCharacterFunctionsandStrings/ctype.h字符函数和字符串 495
Command-LineArguments/命令行参数 497
Command-LineArgumentsinIntegratedEnvironments/集成环境中的命令行参数 500
Command-LineArgumentswiththeMacintosh/Macintosh中的命令行参数 500
String-to-NumberConversions/把字符串转换为数字 500
KeyConcepts/关键概念 504
Summary/本章小结 504
ReviewQuestions/复习题 505
ProgrammingExercises/编程练习 508
12StorageClasses,Linkage,andMemoryManagement 511
第12章存储类别、链接和内存管理
StorageClasses/存储类别 511
Scope/作用域 513
Linkage/链接 515
StorageDuration/存储期 516
AutomaticVariables/自动变量 518
RegisterVariables/寄存器变量 522
StaticVariableswithBlockScope/块作用域的静态变量 522
StaticVariableswithExternalLinkage/外部链接的静态变量 524
StaticVariableswithInternalLinkage/内部链接的静态变量 529
MultipleFiles/多文件 530
Storage-ClassSpecifierRoundup/存储类别说明符 530
StorageClassesandFunctions/存储类别和函数 533
WhichStorageClass?/存储类别的选择 534
ARandom-NumberFunctionandaStaticVariable/随机数函数和静态变量 534
Roll’Em/掷骰子 538
AllocatedMemory:malloc()andfree()/分配内存:malloc()和free() 543
TheImportanceoffree()/free()的重要性 547
Thecalloc()Function/calloc()函数 548
DynamicMemoryAllocationandVariable-LengthArrays/动态内存分配和变长数组 548
StorageClassesandDynamicMemoryAllocation/存储类别和动态内存分配 549
ANSICTypeQualifiers/ANSIC类型限定符 551
TheconstTypeQualifier/const类型限定符 552
ThevolatileTypeQualifier/volatile类型限定符 554
TherestrictTypeQualifier/restrict类型限定符 555
The_AtomicTypeQualifier(C11)/_Atomic类型限定符(C11) 556
NewPlacesforOldKeywords/旧关键字的新位置 557
KeyConcepts/关键概念 558
Summary/本章小结 558
ReviewQuestions/复习题 559
ProgrammingExercises/编程练习 561
13FileInput/Output 565
第13章文件输入/输出
CommunicatingwithFiles/与文件进行通信 565
WhatIsaFile?/文件是什么 566
TheTextModeandtheBinaryMode/文本模式和二进制模式 566
LevelsofI/O/I/O的级别 568
StandardFiles/标准文件 568
StandardI/O/标准I/O 568
CheckingforCommand-LineArguments/检查命令行参数 569
Thefopen()Function/fopen()函数 570
Thegetc()andputc()Functions/getc()和putc()函数 572
End-of-File/文件结尾 572
Thefclose()Function/fclose()函数 574
PointerstotheStandardFiles/指向标准文件的指针 574
ASimple-MindedFile-CondensingProgram/一个简单的文件压缩程序 574
FileI/O:fprintf(),fscanf(),fgets(),andfputs()
/文件I/O:fprintf()、fscanf()、fgets()和fputs() 576
Thefprintf()andfscanf()Functions/fprintf()和fscanf()函数 576
Thefgets()andfputs()Functions/fgets()和fputs()函数 578
AdventuresinRandomAccess:fseek()andftell()
/随机访问:fseek()和ftell() 579
Howfseek()andftell()Work/fseek()和ftell()的工作原理 580
BinaryVersusTextMode/二进制模式和文本模式 582
Portability/可移植性 582
Thefgetpos()andfsetpos()Functions/fgetpos()和fsetpos()函数 583
BehindtheSceneswithStandardI/O/标准I/O的机理 583
OtherStandardI/OFunctions/其他标准I/O函数 584
Theintungetc(intc,FILE*fp)Function/intungetc(intc,FILE*fp)函数 585
Theintfflush()Function/intfflush()函数 585
Theintsetvbuf()Function/intsetvbuf()函数 585
BinaryI/O:fread()andfwrite()/二进制I/O:fread()和fwrite() 586
Thesize_tfwrite()Function/size_tfwrite()函数 588
Thesize_tfread()Function/size_tfread()函数 588
Theintfeof(FILE*fp)andintferror(FILE*fp)Functions
/intfeof(FILE*fp)和intferror(FILE*fp)函数 589
Anfread()andfwrite()Example/一个程序示例 589
RandomAccesswithBinaryI/O/用二进制I/O进行随机访问 593
KeyConcepts/关键概念 594
Summary/本章小结 595
ReviewQuestions/复习题 596
ProgrammingExercises/编程练习 598
14StructuresandOtherDataForms 601
第14章结构和其他数据形式
SampleProblem:CreatinganInventoryofBooks/示例问题:创建图书目录 601
SettingUptheStructureDeclaration/建立结构声明 604
DefiningaStructureVariable/定义结构变量 604
InitializingaStructure/初始化结构 606
GainingAccesstoStructureMembers/访问结构成员 607
InitializersforStructures/结构的初始化器 607
ArraysofStructures/结构数组 608
DeclaringanArrayofStructures/声明结构数组 611
IdentifyingMembersofanArrayofStructures/标识结构数组的成员 612
ProgramDiscussion/程序讨论 612
NestedStructures/嵌套结构 613
PointerstoStructures/指向结构的指针 615
DeclaringandInitializingaStructurePointer/声明和初始化结构指针 617
MemberAccessbyPointer/用指针访问成员 617
TellingFunctionsAboutStructures/向函数传递结构的信息 618
PassingStructureMembers/传递结构成员 618
UsingtheStructureAddress/传递结构的地址 619
PassingaStructureasanArgument/传递结构 621
MoreonStructureFeatures/其他结构特性 622
StructuresorPointertoStructures?/结构和结构指针的选择 626
CharacterArraysorCharacterPointersinaStructure
/结构中的字符数组和字符指针 627
Structure,Pointers,andmalloc()/结构、指针和malloc() 628
CompoundLiteralsandStructures(C99)/复合字面量和结构(C99) 631
FlexibleArrayMembers(C99)/伸缩型数组成员(C99) 633
AnonymousStructures(C11)/匿名结构(C11) 636
FunctionsUsinganArrayofStructures/使用结构数组的函数 637
SavingtheStructureContentsinaFile/把结构内容保存到文件中 639
AStructure-SavingExample/保存结构的程序示例 640
ProgramPoints/程序要点 643
Structures:WhatNext?/链式结构 644
Unions:AQuickLook/联合简介 645
UsingUnions/使用联合 646
AnonymousUnions(C11)/匿名联合(C11) 647
EnumeratedTypes/枚举类型 649
enumConstants/enum常量 649
DefaultValues/默认值 650
AssignedValues/赋值 650
enumUsage/enum的用法 650
SharedNamespaces/共享名称空间 652
typedef:AQuickLook/typedef简介 653
FancyDeclarations/其他复杂的声明 655
FunctionsandPointers/函数和指针 657
KeyConcepts/关键概念 665
Summary/本章小结 665
ReviewQuestions/复习题 666
ProgrammingExercises/编程练习 669
15BitFiddling 673
第15章位操作
BinaryNumbers,Bits,andBytes/二进制数、位和字节 674
BinaryIntegers/二进制整数 674
SignedIntegers/有符号整数 675
BinaryFloatingPoint/二进制浮点数 676
OtherNumberBases/其他进制数 676
Octal/八进制 677
Hexadecimal/十六进制 677
C’sBitwiseOperators/C按位运算符 678
BitwiseLogicalOperators/按位逻辑运算符 678
Usage:Masks/用法:掩码 680
Usage:TurningBitsOn(SettingBits)/用法:打开位(设置位) 681
Usage:TurningBitsOff(ClearingBits)/用法:关闭位(清空位) 682
Usage:TogglingBits/用法:切换位 683
Usage:CheckingtheValueofaBit/用法:检查位的值 683
BitwiseShiftOperators/移位运算符 684
ProgrammingExample/编程示例 685
AnotherExample/另一个例子 688
BitFields/位字段 690
Bit-FieldExample/位字段示例 692
BitFieldsandBitwiseOperators/位字段和按位运算符 696
AlignmentFeatures(C11)/对齐特性(C11) 703
KeyConcepts/关键概念 705
Summary/本章小结 706
ReviewQuestions/复习题 706
ProgrammingExercises/编程练习 708
16TheCPreprocessorandtheCLibrary 711
第16章C预处理器和C库
FirstStepsinTranslatingaProgram/翻译程序的第一步 712
ManifestConstants:#define/明示常量:#define 713
Tokens/记号 717
RedefiningConstants/重定义常量 717
UsingArgumentswith#define/在#define中使用参数 718
CreatingStringsfromMacroArguments:The#Operator
/用宏参数创建字符串:#运算符 721
PreprocessorGlue:The##Operator/预处理器粘合剂:##运算符 722
VariadicMacros:...and__VA_ARGS__/变参宏:...和__VA_ARGS__ 723
MacroorFunction?/宏和函数的选择 725
FileInclusion:#include/文件包含:#include 726
HeaderFiles:AnExample/头文件示例 727
UsesforHeaderFiles/使用头文件 729
OtherDirectives/其他指令 730
The#undefDirective/#undef指令 731
BeingDefined—TheCPreprocessorPerspective/从C预处理器角度看已定义 731
ConditionalCompilation/条件编译 731
PredefinedMacros/预定义宏 737
#lineand#error/#line和#error 738
#pragma/#pragma 739
GenericSelection(C11)/泛型选择(C11) 740
InlineFunctions(C99)/内联函数(C99) 741
_NoreturnFunctions(C11)/_Noreturn函数(C11) 744
TheCLibrary/C库 744
GainingAccesstotheCLibrary/访问C库 745
UsingtheLibraryDescriptions/使用库描述 746
TheMathLibrary/数学库 747
ALittleTrigonometry/三角问题 748
TypeVariants/类型变体 750
Thetgmath.hLibrary(C99)/tgmath.h库(C99) 752
TheGeneralUtilitiesLibrary/通用工具库 753
Theexit()andatexit()Functions/exit()和atexit()函数 753
Theqsort()Function/qsort()函数 755
TheAssertLibrary/断言库 760
Usingassert/assert的用法 760
_Static_assert(C11)/_Static_assert(C11) 762
memcpy()andmemmove()fromthestring.hLibrary
/string.h库中的memcpy()和memmove() 763
VariableArguments:stdarg.h/可变参数:stdarg.h 765
KeyConcepts/关键概念 768
Summary/本章小结 768
ReviewQuestions/复习题 768
ProgrammingExercises/编程练习 770
17AdvancedDataRepresentation 773
第17章高级数据表示
ExploringDataRepresentation/研究数据表示 774
BeyondtheArraytotheLinkedList/从数组到链表 777
UsingaLinkedList/使用链表 781
Afterthoughts/反思 786
AbstractDataTypes(ADTs)/抽象数据类型(ADT) 786
GettingAbstract/建立抽象 788
BuildinganInterface/建立接口 789
UsingtheInterface/使用接口 793
ImplementingtheInterface/实现接口 796
GettingQueuedwithanADT/队列ADT 804
DefiningtheQueueAbstractDataType/定义队列抽象数据类型 804
DefininganInterface/定义一个接口 805
ImplementingtheInterfaceDataRepresentation/实现接口数据表示 806
TestingtheQueue/测试队列 815
SimulatingwithaQueue/用队列进行模拟 818
TheLinkedListVersustheArray/链表和数组 824
BinarySearchTrees/二叉查找树 828
ABinaryTreeADT/二叉树ADT 829
TheBinarySearchTreeInterface/二叉查找树接口 830
TheBinaryTreeImplementation/二叉树的实现 833
TryingtheTree/使用二叉树 849
TreeThoughts/树的思想 854
OtherDirections/其他说明 856
KeyConcepts/关键概念 856
Summary/本章小结 857
ReviewQuestions/复习题 857
ProgrammingExercises/编程练习 858
AAnswerstotheReviewQuestions 861
附录A复习题答案
AnswerstoReviewQuestionsforChapter1/第1章复习题答案 861
AnswerstoReviewQuestionsforChapter2/第2章复习题答案 862
AnswerstoReviewQuestionsforChapter3/第3章复习题答案 863
AnswerstoReviewQuestionsforChapter4/第4章复习题答案 866
AnswerstoReviewQuestionsforChapter5/第5章复习题答案 869
AnswerstoReviewQuestionsforChapter6/第6章复习题答案 872
AnswerstoReviewQuestionsforChapter7/第7章复习题答案 876
AnswerstoReviewQuestionsforChapter8/第8章复习题答案 879
AnswerstoReviewQuestionsforChapter9/第9章复习题答案 881
AnswerstoReviewQuestionsforChapter10/第10章复习题答案 883
AnswerstoReviewQuestionsforChapter11/第11章复习题答案 886
AnswerstoReviewQuestionsforChapter12/第12章复习题答案 890
AnswerstoReviewQuestionsforChapter13/第13章复习题答案 891
AnswerstoReviewQuestionsforChapter14/第14章复习题答案 894
AnswerstoReviewQuestionsforChapter15/第15章复习题答案 898
AnswerstoReviewQuestionsforChapter16/第16章复习题答案 899
AnswerstoReviewQuestionsforChapter17/第17章复习题答案 901
BReferenceSection 905
附录B参考资料
SectionⅠ:AdditionalReading/参考资料Ⅰ:补充阅读 905
OnlineResources/在线资源 905
CLanguageBooks/C语言书籍 907
ProgrammingBooks/编程书籍 907
ReferenceBooks/参考书籍 908
C++Books/C++书籍 908
SectionⅡ:COperators/参考资料Ⅱ:C运算符 908
ArithmeticOperators/算术运算符 909
RelationalOperators/关系运算符 910
AssignmentOperators/赋值运算符 910
LogicalOperators/逻辑运算符 911
TheConditionalOperator/条件运算符 911
Pointer-RelatedOperators/与指针有关的运算符 912
SignOperators/符号运算符 912
StructureandUnionOperators/结构和联合运算符 912
BitwiseOperators/按位运算符 913
MiscellaneousOperators/混合运算符 914
SectionⅢ:BasicTypesandStorageClasses
/参考资料Ⅲ:基本类型和存储类别 915
Summary:TheBasicDataTypes/总结:基本数据类型 915
Summary:HowtoDeclareaSimpleVariable/总结:如何声明一个简单变量 917
Summary:Qualifiers/总结:限定符 919
SectionⅣ:Expressions,Statements,andProgramFlow
/参考资料Ⅳ:表达式、语句和程序流 920
Summary:ExpressionsandStatements/总结:表达式和语句 920
Summary:ThewhileStatement/总结:while语句 921
Summary:TheforStatement/总结:for语句 921
Summary:ThedowhileStatement/总结:dowhile语句 922
Summary:UsingifStatementsforMakingChoices/总结:if语句 923
Summary:MultipleChoicewithswitch/带多重选择的switch语句 924
Summary:ProgramJumps/总结:程序跳转 925
SectionⅤ:TheStandardANSICLibrarywithC99andC11Additions
/参考资料Ⅴ:新增C99和C11的ANSIC库 926
Diagnostics:assert.h/断言:assert.h 926
ComplexNumbers:complex.h(C99)/复数:complex.h(C99) 927
CharacterHandling:ctype.h/字符处理:ctype.h 929
ErrorReporting:errno.h/错误报告:errno.h 930
Floating-PointEnvironment:fenv.h(C99)/浮点环境:fenv.h(C99) 930
Floating-pointCharacteristics:float.h/浮点特性:float.h 933
FormatConversionofIntegerTypes:inttypes.h(C99)/整数类型的格式转换:inttypes.h 935
AlternativeSpellings:iso646.h/可选拼写:iso646.h 936
Localization:locale.h/本地化:locale.h 936
MathLibrary:math.h/数学库:math.h 939
Non-LocalJumps:setjmp.h/非本地跳转:setjmp.h 945
SignalHandling:signal.h/信号处理:signal.h 945
Alignment:stdalign.h(C11)/对齐:stdalign.h(C11) 946
VariableArguments:stdarg.h/可变参数:stdarg.h 947
AtomicsSupport:stdatomic.h(C11)/原子支持:stdatomic.h(C11) 948
BooleanSupport:stdbool.h(C99)/布尔支持:stdbool.h(C99) 948
CommonDefinitions:stddef.h/通用定义:stddef.h 948
IntegerTypes:stdint.h/整数类型:stdint.h 949
StandardI/OLibrary:stdio.h/标准I/O库:stdio.h 953
GeneralUtilities:stdlib.h/通用工具:stdlib.h 956
_Noreturn:stdnoreturn.h/_Noreturn:stdnoreturn.h 962
StringHandling:string.h/处理字符串:string.h 962
Type-GenericMath:tgmath.h(C99)/通用类型数学:tgmath.h(C99) 965
Threads:threads.h(C11)/线程:threads.h(C11) 967
DateandTime:time.h/日期和时间:time.h 967
UnicodeUtilities:uchar.h(C11)/统一码工具:uchar.h(C11) 971
ExtendedMultibyteandWide-CharacterUtilities:wchar.h(C99)
/扩展的多字节字符和宽字符工具:wchar.h(C99) 972
WideCharacterClassificationandMappingUtilities:wctype.h(C99)
/宽字符分类和映射工具:wctype.h(C99) 978
SectionⅥ:ExtendedIntegerTypes/参考资料Ⅵ:扩展的整数类型 980
Exact-WidthTypes/精确宽度类型 981
Minimum-WidthTypes/最小宽度类型 982
FastestMinimum-WidthTypes/最快最小宽度类型 983
Maximum-WidthTypes/最大宽度类型 983
IntegersThatCanHoldPointerValues/可储存指针值的整型 984
ExtendedIntegerConstants/扩展的整型常量 984
SectionⅦ:ExpandedCharacterSupport/参考资料Ⅶ:扩展字符支持 984
TrigraphSequences/三字符序列 984
Digraphs/双字符 985
AlternativeSpellings:iso646.h/可选拼写:iso646.h 986
MultibyteCharacters/多字节字符 986
UniversalCharacterNames(UCNs)/通用字符名(UCN) 987
WideCharacters/宽字符 988
WideCharactersandMultibyteCharacters/宽字符和多字节字符 989
SectionⅧ:C99/C11NumericComputationalEnhancements
/参考资料Ⅷ:C99/C11数值计算增强 990
TheIECFloating-PointStandard/IEC浮点标准 990
Thefenv.hHeaderFile/fenv.h头文件 994
TheSTDCFP_CONTRACTPragma/STDCFP_CONTRACT编译指示 995
Additionstothemath.hLibrary/math.h库增补 995
SupportforComplexNumbers/对复数的支持 996
SectionⅨ:DifferencesBetweenCandC++/参考资料Ⅸ:C和C++的区别 998
FunctionPrototypes/函数原型 999
charConstants/char常量 1000
TheconstModifier/const限定符 1000
StructuresandUnions/结构和联合 1001
Enumerations/枚举 1002
Pointer-to-void/指向void的指针 1002
BooleanTypes/布尔类型 1003
AlternativeSpellings/可选拼写 1003
Wide-CharacterSupport/宽字符支持 1003
ComplexTypes/复数类型 1003
InlineFunctions/内联函数 1003
C99/11FeaturesNotFoundinC++11/C++11中没有的C99/C11特性 1004

其他推荐