
| |
|
|
| PartI:ObjectsandC++ Chapter1Arrays,Pointers,andStructures3 1.1WhatArePointers,Arrays,andStructures?3 1.2ArraysandStrings4 1.2.1First-ClassVersusSecond-ClassObjects4 1.2.2Usingthevector6 1.2.3Resizingavector7 1.2.4push_back:sizeandcapacity11 1.2.5Parameter-PassingMechanisms11 1.2.6PrimitiveArraysofConstants13 1.2.7MultidimensionalArrays14 1.2.8TheStandardLibrarystringType14 1.3PointerSyntaxinC++15 1.4DynamicMemoryManagement20 1.4.1ThenewOperator21 1.4.2GarbageCollectionanddelete21 1.4.3StalePointers,DoubleDeletion,andMore22 1.5ReferenceVariables24 1.6Structures26 1.6.1PointerstoStructures28 1.6.2ExogenousVersusIndigenousDataandShallowVersusDeep Copying29 1.6.3NoncontiguousLists:LinkedLists30 Summary32 ObjectsoftheGame32 CommonErrors34 OntheInternet35 Exercises35 References38 Chapter2 ObjectsandClasses41 2.1WhatIsObject-OrientedProgramming?41 2.2BasicclassSyntax43 2.2.1ClassMembers43 2.2.2ExtraConstructorSyntaxandAccessors45 2.2.3SeparationofInterfaceandImplementation48 2.2.4TheBigThree:Destructor,CopyConstructor,and operator=51 2.2.5DefaultConstructor57 2.3AdditionalC++ClassFeatures57 2.3.1InitializationVersusAssignmentintheConstructor Revisited61 2.3.2TypeConversions63 2.3.3OperatorOverloading64 2.3.4InputandOutputandFriends67 2.4SomeCommonIdioms68 2.4.1AvoidingFriends70 2.4.2StaticClassMembers71 2.4.3TheenumTrickforIntegerClassConstants71 2.5Exceptions72 2.6AstringClass73 2.7Recap:WhatGetsCalledandWhatAretheDefaults?82 2.8Composition84 Summary85 ObjectsoftheGame85 CommonErrors87 OntheIntemet89 Exercises90 References96 Chapter3 Templates97 Chapter4 Inheritance119 Chapter5 DesignPatterns155 PartII:AlgorithmsandBuildingBlocks PartIII:Applications PartIV:Implementations Appendix A Appendix B Appendix C |
商品评论(0条)