編輯推薦
新標準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 電子書 格式