编辑推荐
新标准C++11发布,距上一版本已10年;《C++Primer英文版(第5版)》是持续更新的全球C++读本。
经过前四个版本积累,第5版的体例堪称完美。
这一版本作者历时3年完成,极力避免在原版上升级,而是将C++11的新特性真正融入各章节;更将所有代码示例用C++11的简化写法完成,而不是仅单独增加内容。
内容简介
《C++ Primer英文版(第5版)》久负盛名的C++经典教程,时隔八年之久,终迎来的重大升级。除令全球无数程序员从中受益,甚至为之迷醉的--C++大师Stanley B. Lippman的丰富实践经验,C++标准委员会原负责人Josée Lajoie对C++标准的深入理解,以及C++先驱Barbara E. Moo在C++教学方面的真知灼见外,更是基于全新的C++11标准进行了全面而彻底的内容更新。非常难能可贵的是,书中所有示例均全部采用C++11标准改写,这在经典升级版中极其罕见--充分体现了C++语言的重大进展极其全面实践。书中丰富的教学辅助内容、醒目的知识点提示,以及精心组织的编程示范,让《C++ Primer英文版(第5版)》这本书在C++领域的专业地位更加不可动摇。无论是初学者入门,或是中、高级程序员提升,《C++ Primer英文版(第5版)》均为不容置疑的优选。
作者简介
Stanley B. Lippman,目前是微软公司 Visual C++ 团队的架构师。他从1984年开始在贝尔实验室与C++的设计者Bjarne Stroustrup一起从事C++的设计与开发。他在迪士尼和梦工厂从事动画制作,还担任过JPL的高级顾问。
Josée Lajoie,曾经是IBM加拿大研究中心C/C++编译器开发团队的成员,在ISO C++标准委员会工作了7年,担任过ISO核心语言工作组的主席和C++ Report杂志的专栏作家。
Barbara E. Moo,拥有25年软件经验的独立咨询顾问。在AT&T;,她与Stroustrup、Lippman一起管理过复杂的C++开发项目。
目录
Preface xxiii
Chapter 1 Getting Started
1.1 Writing a Simple C++Program
1.1.1 Compiling and Executing Our Program
1.2 AFirstLookat Input/Output
1.3 AWordaboutComments
1.4 FlowofControl
1.4.1 The whileStatement
1.4.2 The forStatement
1.4.3 ReadinganUnknownNumberof Inputs
1.4.4 The ifStatement
1.5 IntroducingClasses
1.5.1 The Sales_itemClass
1.5.2 AFirstLookatMemberFunctions
1.6 TheBookstoreProgram
ChapterSummary
DefinedTerms
Part I The Basics
Chapter 2 Variables and Basic Types
2.1 PrimitiveBuilt-inTypes
2.1.1 ArithmeticTypes
2.1.2 TypeConversions
2.1.3 Literals
2.2 Variables
2.2.1 VariableDefinitions
2.2.2 VariableDeclarations andDefinitions
2.2.3 Identifiers
2.2.4 Scopeof aName
2.3 CompoundTypes
2.3.1 References
2.3.2 Pointers
vii
viii Contents
2.3.3 UnderstandingCompoundTypeDeclarations
2.4 constQualifier
2.4.1 References to const
2.4.2 Pointers and const
2.4.3 Top-Level const
2.4.4 constexprandConstantExpressions
2.5 DealingwithTypes
2.5.1 TypeAliases
2.5.2 The autoTypeSpecifier
2.5.3 The decltypeTypeSpecifier
2.6 DefiningOurOwnDataStructures
2.6.1 Defining the Sales_dataType
2.6.2 Using the Sales_dataClass
2.6.3 Writing Our Own Header Files
ChapterSummary
DefinedTerms
Chapter 3 Strings, Vectors, and Arrays
3.1 Namespace usingDeclarations
3.2 Library stringType
3.2.1 Defining and Initializing strings
3.2.2 Operations on strings
3.2.3 Dealing with the Characters in a string
3.3 Library vectorType
3.3.1 Defining and Initializing vectors
3.3.2 Adding Elements to a vector
3.3.3 Other vectorOperations
3.4 IntroducingIterators
3.4.1 UsingIterators
3.4.2 IteratorArithmetic
3.5 Arrays
3.5.1 DefiningandInitializingBuilt-inArrays
3.5.2 AccessingtheElementsof anArray
3.5.3 Pointers andArrays
3.5.4 C-StyleCharacterStrings
3.5.5 InterfacingtoOlderCode
3.6 MultidimensionalArrays
ChapterSummary
DefinedTerms
Chapter 4 Expressions
4.1 Fundamentals
4.1.1 BasicConcepts
4.1.2 PrecedenceandAssociativity
4.1.3 OrderofEvaluation
4.2 ArithmeticOperators
4.3 Logical andRelationalOperators
Contents ix
4.4 AssignmentOperators
4.5 Increment andDecrementOperators
4.6 TheMemberAccessOperators
4.7 TheConditionalOperator
4.8 TheBitwiseOperators
4.9 The sizeofOperator
4.10 CommaOperator
4.11 TypeConversions
4.11.1 TheArithmeticConversions
4.11.2 Other ImplicitConversions
4.11.3 ExplicitConversions
4.12 OperatorPrecedenceTable
ChapterSummary
DefinedTerms
Chapter 5 Statements
5.1 Simple Statements
5.2 StatementScope
5.3 Conditional Statements
5.3.1 The ifStatement
5.3.2 The switchStatement
5.4 IterativeStatements
5.4.1 The whileStatement
5.4.2 Traditional forStatement
5.4.3 Range forStatement
5.4.4 The do whileStatement
5.5 JumpStatements
5.5.1 The breakStatement
5.5.2 The continueStatement
5.5.3 The gotoStatement
5.6 tryBlocks andExceptionHandling
5.6.1 A throwExpression
5.6.2 The tryBlock
5.6.3 StandardExceptions
ChapterSummary
DefinedTerms
Chapter 6 Functions
6.1 FunctionBasics
6.1.1 LocalObjects
6.1.2 FunctionDeclarations
6.1.3 SeparateCompilation
6.2 ArgumentPassing
6.2.1 PassingArgumentsbyValue
6.2.2 PassingArgumentsbyReference
6.2.3 constParametersandArguments
6.2.4 ArrayParameters
x Contents
6.2.5 main:HandlingCommand-LineOptions
6.2.6 FunctionswithVaryingParameters
6.3 Return Types and the returnStatement
6.3.1 FunctionswithNoReturnValue
6.3.2 FunctionsThatReturnaValue
6.3.3 ReturningaPointer toanArray
6.4 OverloadedFunctions
6.4.1 OverloadingandScope
6.5 Features forSpecializedUses
6.5.1 DefaultArguments
6.5.2 Inline and constexprFunctions
6.5.3 Aids for Debugging
6.6 FunctionMatching
6.6.1 ArgumentTypeConversions
6.7 Pointers toFunctions
ChapterSummary
DefinedTerms
Chapter 7 Classes
7.1 DefiningAbstractDataTypes
7.1.1 Designing the Sales_dataClass
7.1.2 Defining the Revised Sales_dataClass
7.1.3 DefiningNonmemberClass-RelatedFunctions
7.1.4 Constructors
7.1.5 Copy,Assignment, andDestruction
7.2 AccessControl andEncapsulation
7.2.1 Friends
7.3 AdditionalClassFeatures
7.3.1 ClassMembersRevisited
7.3.2 Functions That Return *this
7.3.3 ClassTypes
7.3.4 FriendshipRevisited
7.4 ClassScope
7.4.1 NameLookupandClassScope
7.5 ConstructorsRevisited
7.5.1 Constructor InitializerList
7.5.2 DelegatingConstructors
7.5.3 TheRoleof theDefaultConstructor
7.5.4 ImplicitClass-TypeConversions
7.5.5 AggregateClasses
7.5.6 LiteralClasses
7.6 staticClassMembers
ChapterSummary
DefinedTerms
Contents xi
Part II The C++ Library
Chapter 8 The IO Library
8.1 The IOClasses
8.1.1 NoCopyorAssignfor IOObjects
8.1.2 ConditionStates
8.1.3 ManagingtheOutputBuffer
8.2 File Input and Output
8.2.1 Using File Stream Objects
8.2.2 File Modes
8.3 stringStreams
8.3.1 Using an istringstream
8.3.2 Using ostringstreams
ChapterSummary
DefinedTerms
Chapter 9 Sequential Containers
9.1 Overviewof the SequentialContainers
9.2 ContainerLibraryOverview
9.2.1 Iterators
9.2.2 ContainerTypeMembers
9.2.3 begin and endMembers
9.2.4 DefiningandInitializingaContainer
9.2.5 Assignment and swap
9.2.6 ContainerSizeOperations
9.2.7 RelationalOperators
9.3 SequentialContainerOperations
9.3.1 AddingElements toaSequentialContainer
9.3.2 AccessingElements
9.3.3 ErasingElements
9.3.4 Specialized forward_listOperations
9.3.5 ResizingaContainer
9.3.6 ContainerOperationsMayInvalidateIterators
9.4 How a vectorGrows
9.5 Additional stringOperations
9.5.1 Other Ways to Construct strings
9.5.2 Other Ways to Change a string
9.5.3 stringSearchOperations
9.5.4 The compareFunctions
9.5.5 NumericConversions
9.6 ContainerAdaptors
ChapterSummary
DefinedTerms
xii Contents
Chapter 10 Generic Algorithms
10.1 Overview
10.2 AFirstLookat theAlgorithms
10.2.1 Read-OnlyAlgorithms
10.2.2 AlgorithmsThatWriteContainerElements
10.2.3 AlgorithmsThatReorderContainerElements
10.3 CustomizingOperations
10.3.1 PassingaFunctiontoanAlgorithm
10.3.2 LambdaExpressions
10.3.3 LambdaCapturesandReturns
10.3.4 BindingArguments
10.4 Revisiting Iterators
10.4.1 Insert Iterators
10.4.2 iostream Iterators
10.4.3 Reverse Iterators
10.5 StructureofGenericAlgorithms
10.5.1 TheFive IteratorCategories
10.5.2 AlgorithmParameterPatterns
10.5.3 AlgorithmNamingConventions
10.6 Container-SpecificAlgorithms
ChapterSummary
DefinedTerms
Chapter 11 Associative Containers
11.1 UsinganAssociativeContainer
11.2 Overviewof theAssociativeContainers
11.2.1 DefininganAssociativeContainer
11.2.2 Requirements onKeyType
11.2.3 The pairType
11.3 Operations onAssociativeContainers
11.3.1 AssociativeContainer Iterators
11.3.2 AddingElements
11.3.3 ErasingElements
11.3.4 Subscripting a map
11.3.5 AccessingElements
11.3.6 AWordTransformationMap
11.4 TheUnorderedContainers
ChapterSummary
DefinedTerms <
C++ Primer英文版(第5版) 电子书 下载 mobi epub pdf txt