Tải bản đầy đủ (.pdf) (2,488 trang)

Sams c++ primer plus fourth edition

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (11.21 MB, 2,488 trang )






TableofContents
Index

C++PrimerPlus,FourthEdition
ByStephenPrata

Publisher :SamsPublishing
PubDate :November14,2001
ISBN :0-672-32223-4
Pages :1128


C++PrimerPlus,FourthEditionpresentsthe
ANSIC++standardbeginningwitha
discussionoftheessentialelementsofC++
programming:loops,expressions,functions,
andclasses.Itwalksreadersthroughthe
basicsofobject-orientedprogramming:
classes,inheritance,templates,and
exceptions,aswellasthelatestobjectorientedprogrammingtechniques.C++
PrimerPluscontainshundredsofsample
programs.Thefriendlytone,concise
programs,andend-of-chapterreview


exercisesallowbeginnerstowritetheirown


programsimmediately.







TableofContents
Index

C++PrimerPlus,FourthEdition
ByStephenPrata

Publisher :SamsPublishing
PubDate :November14,2001
ISBN :0-672-32223-4
Pages :1128



Copyright

PREFACE
PrefacetotheFourthEdition

NotetoInstructors




HowThisBookIsOrganized








ABOUTTHEAUTHOR
ACKNOWLEDGMENTS
TELLUSWHATYOUTHINK!
Chapter1.GETTINGSTARTED
LearningC++




PortabilityandStandards




ConventionsUsedinThisBook

ALittleHistory
TheMechanicsofCreatingaProgram
OurSystem



Chapter2.SETTINGOUTTOC++
C++Initiation

MoreAboutC++Statements



MoreC++Statements




Functions




Summary



ProgrammingExercises

ReviewQuestions


Chapter3.DEALINGWITHDATA
SimpleVariables

TheconstQualifier





Floating-PointNumbers




Summary



ProgrammingExercises

C++ArithmeticOperators
ReviewQuestions


Chapter4.COMPOUNDTYPES
IntroducingArrays

Strings




IntroducingStructures





Enumerations




Pointers,Arrays,andPointerArithmetic




ReviewQuestions

Unions
PointersandtheFreeStore
Summary
ProgrammingExercises


Chapter5.LOOPSANDRELATIONALEXPRESSIONS
IntroducingtheforLoop

RelationalExpressions




ThewhileLoop





LoopsandTextInput




Summary



ProgrammingExercises

ThedowhileLoop
NestedLoopsandTwo-DimensionalArrays
ReviewQuestions


Chapter6.BRANCHINGSTATEMENTSANDLOGICALOPERATORS
TheifStatement

LogicalExpressions




ThecctypeLibraryofCharacterFunctions




TheswitchStatement

The?:Operator





ThebreakandcontinueStatements




Summary



ProgrammingExercises

Number-ReadingLoops
ReviewQuestions


Chapter7.FUNCTIONSC++'SPROGRAMMINGMODULES
FunctionReview

FunctionArgumentsandPassingbyValue





FunctionsandArrays




FunctionsandC-StyleStrings




Recursion




Summary



ProgrammingExercises

FunctionsandTwo-DimensionalArrays
FunctionsandStructures
PointerstoFunctions
ReviewQuestions


Chapter8.ADVENTURESINFUNCTIONS

InlineFunctions

ReferenceVariables




DefaultArguments




FunctionTemplates




ReviewQuestions

FunctionPolymorphism(FunctionOverloading)
Summary
ProgrammingExercises


Chapter9.MEMORYMODELSANDNAMESPACES
SeparateCompilation

StorageDuration,Scope,andLinkage





Namespaces




ReviewQuestions

Summary
ProgrammingExercises


Chapter10.OBJECTSANDCLASSES
ProceduralandObject-OrientedProgramming

AbstractionandClasses




ClassConstructorsandDestructors



AnArrayofObjects

KnowingYourObjects:ThethisPointer






ClassScope




Summary



ProgrammingExercises

AnAbstractDataType
ReviewQuestions


Chapter11.WORKINGWITHCLASSES
OperatorOverloading

TimeonOurHands




IntroducingFriends





MoreOverloading:AVectorClass




Summary



ProgrammingExercises

OverloadedOperators:MemberVersusNonmemberFunctions
AutomaticConversionsandTypeCastsforClasses
ReviewQuestions


Chapter12.CLASSESANDDYNAMICMEMORYALLOCATION
DynamicMemoryandClasses

AQueueSimulation




Summary



ProgrammingExercises


ReviewQuestions


Chapter13.CLASSINHERITANCE
BeginningwithaSimpleBaseClass

SpecialRelationships




InheritanceAnIs-aRelationship




AccessControl-protected




InheritanceandDynamicMemoryAllocation




Summary




ProgrammingExercises

PolymorphicPublicInheritance
AbstractBaseClasses
ClassDesignReview
ReviewQuestions


Chapter14.REUSINGCODEINC++
ClasseswithObjectMembers

PrivateInheritance




MultipleInheritance



Summary

ClassTemplates





ReviewQuestions

ProgrammingExercises


Chapter15.FRIENDS,EXCEPTIONS,ANDMORE
Friends

NestedClasses




Exceptions




TypeCastOperators




ReviewQuestions

RTTI
Summary
ProgrammingExercises


Chapter16.THEstringCLASSANDTHESTANDARDTEMPLATELIBRARY
ThestringClass


Theauto_ptrClass




TheStandardTemplateLibrary




FunctionObjects(akaFunctors)




OtherLibraries




ReviewQuestions

GenericProgramming
Algorithms
Summary
ProgrammingExercises


Chapter17.INPUT,OUTPUT,ANDFILES

AnOverviewofC++InputandOutput

Outputwithcout




Inputwithcin




IncoreFormatting




Summary



ProgrammingExercises

FileInputandOutput
WhatNow?
ReviewQuestions


AppendixA.NUMBERBASES
OctalIntegers


HexadecimalNumbers






BinaryNumbers
BinaryandHex
AppendixB.C++KEYWORDS
AppendixC.THEASCIICHARACTERSET



AppendixD.OPERATORPRECEDENCE

AppendixE.OTHEROPERATORS
BitwiseOperators

MemberDereferencingOperators


AppendixF.THEstringTEMPLATECLASS
ThirteenTypesandaConstant

DataInformation,Constructors,andSoOn





StringAccess




StringSearching




StringModifiers

BasicAssignment
ComparisonMethodsandFunctions
OutputandInput


AppendixG.THESTLMETHODSANDFUNCTIONS
MembersCommontoAllContainers

AdditionalMembersforVectors,Lists,andDeques




AdditionalMembersforSetsandMaps
STLFunctions



AppendixH.SELECTEDREADINGS

AppendixI.CONVERTINGTOANSI/ISOSTANDARDC++
PreprocessorDirectives

UseFunctionPrototypes




TypeCasts




UsetheNewHeaderOrganization




UsetheautoptrTemplate



UsetheSTL

BecomeFamiliarwithC++Features
UseNamespaces
UsethestringClass



AppendixJ.ANSWERSTOREVIEWQUESTIONS
Chapter2

Chapter3




Chapter4




Chapter6




Chapter8



Chapter10

Chapter5
Chapter7
Chapter9





Chapter11




Chapter12




Chapter14




Chapter16



Chapter13
Chapter15
Chapter17
Index


Copyright
Copyright©2002bySamsPublishing
Allrightsreserved.Nopartofthisbookshallbereproduced,

storedinaretrievalsystem,ortransmittedbyanymeans,
electronic,mechanical,photocopying,recording,orotherwise,
withoutwrittenpermissionfromthepublisher.Nopatent
liabilityisassumedwithrespecttotheuseoftheinformation
containedherein.Althougheveryprecautionhasbeentakenin
thepreparationofthisbook,thepublisherandauthorassume
noresponsibilityforerrorsoromissions.Norisanyliability
assumedfordamagesresultingfromtheuseoftheinformation
containedherein.
LibraryofCongressCatalogCardNumber:2001089224
PrintedintheUnitedStatesofAmerica
FirstPrinting:November2001
030201004321

Trademarks
Alltermsmentionedinthisbookthatareknowntobe
trademarksorservicemarkshavebeenappropriately
capitalized.SamsPublishingcannotattesttotheaccuracyof
thisinformation.Useofaterminthisbookshouldnotbe
regardedasaffectingthevalidityofanytrademarkorservice
mark.

WarningandDisclaimer


Everyefforthasbeenmadetomakethisbookascompleteand
asaccurateaspossible,butnowarrantyorfitnessisimplied.
Theinformationprovidedisonan"asis"basis.Theauthorand
thepublishershallhaveneitherliabilitynorresponsibilitytoany
personorentitywithrespecttoanylossordamagesarising

fromtheinformationcontainedinthisbookorfromtheuseof
theprogramsaccompanyingit.

Credits
ASSOCIATEPUBLISHER
LindaEngelman
ACQUISITIONSEDITOR
LindaScharp
DEVELOPMENTEDITOR
KarenWachs
MANAGINGEDITOR
CharlotteClapp
INDEXER
KellyCastell
PROOFREADERS
BobLaRoche
JessicaMcCarty


TECHNICALEDITORS
PhilippeBruno
BillCraun
MichaelMaddox
ChrisMaunder
TEAMCOORDINATOR
LynneWilliams
INTERIORDESIGNER
GaryAdair
COVERDESIGNER
GaryAdair

PAGELAYOUT
AyannaLacey
StaceyRichwine-DeRome

DEDICATION
TomycolleaguesandstudentsattheCollegeofMarin,with
whomitisapleasuretowork.
StephenPrata


PREFACE
PrefacetotheFourthEdition
NotetoInstructors
HowThisBookIsOrganized


PrefacetotheFourthEdition
LearningC++isanadventureofdiscovery,particularlybecause
thelanguageaccommodatesseveralprogrammingparadigms,
includingobject-orientedprogramming,genericprogramming,
andthetraditionalproceduralprogramming.C++hasbeena
movingtargetasthelanguageaddednewfeatures,butnow,
withtheISO/ANSIC++Standardof1998inplace,the
languagehasstabilized.Contemporarycompilerssupportmost
orallofthefeaturesmandatedbythestandard,and
programmershavehadtimetogetusedtoapplyingthese
features.TheFourthEditionofC++PrimerPlusreflectsthe
ISO/ANSIstandardanddescribesthismaturedversionofC++.
C++PrimerPlusintegratesdiscussingthebasicClanguage
withpresentingC++features,makingthisbookself-contained.

ItpresentsC++fundamentalsandillustratesthemwithshort,
to-the-pointprogramsthatareeasytocopyandexperiment
with.You'lllearnaboutinputandoutput,howtomake
programsperformrepetitivetasksandmakechoices,themany
waystohandledata,andhowtousefunctions.You'lllearn
aboutthemanyfeaturesC++hasaddedtoC,includingthe
following:
Classesandobjects
Inheritance
Polymorphism,virtualfunctions,andRTTI(runtimetype
identification)
Functionoverloading
Referencevariables


Generic,ortype-independentprogramming,asprovidedby
templatesandtheStandardTemplateLibrary(STL)
Theexceptionmechanismforhandlingerrorconditions
Namespacesformanagingnamesoffunctions,classes,and
variables
C++PrimerPlusbringsseveralvirtuestothetaskofpresenting
allthismaterial.ItbuildsupontheprimertraditionbegunbyC
PrimerPlusnearlytwodecadesagoandembracesitssuccessful
philosophy:
Aprimershouldbeaneasy-to-use,friendlyguide.
Aprimerdoesn'tassumethatyoualreadyarefamiliarwith
allrelevantprogrammingconcepts.
Aprimeremphasizeshands-onlearningwithbrief,easily
typedexamplesthatdevelopyourunderstandingaconcept
ortwoatatime.

Aprimerclarifiesconceptswithillustrations.
Aprimerprovidesquestionsandexercisestoletyoutest
yourunderstanding,makingthebooksuitableforselflearningorfortheclassroom.
Thebookhelpsyouunderstandthisrichlanguageandhowto
useit.
Itprovidesconceptualguidanceaboutwhentouse
particularfeatures,suchasusingpublicinheritanceto
modelwhatareknownasis-arelationships.


ItillustratescommonC++programmingidiomsand
techniques.
Itprovidesavarietyofsidebars,includingtips,cautions,
andreal-worldnotes.
We(theauthorandeditors)doourbesttokeepthe
presentationto-the-point,simple,andfun.Ourgoalisthatby
theendofthebookyou'llbeabletowritesolid,effective
programsandenjoyyourselfdoingso.
Likethepreviouseditions,thisbookpracticesgenericC++so
thatitisnottiedtoanyparticularkindofcomputer,operating
system,orcompiler.Alltheprogramsweretestedwith
CodeWarriorPro6(MacintoshandWindows)andMicrosoft
VisualC++6.0,andmostweretestedwithBorlandC++
Command-LineCompiler5.5,Gnug++2.9.5runningunder
DOS,andComeauC/C++4.42.5runningunderLinux.Onlya
fewprogramswereaffectedbycompilernon-conformance
issues.
C++offersalottotheprogrammer;learnandenjoy!



NotetoInstructors
Oneofthegoalsofthefourtheditionistoprovideabookthat
canbeusedaseitherateach-yourselfbookoratextbook.Here
aresomeofthefeaturesthatsupportusingC++PrimerPlus,
FourthEditionasatextbook:
ThisbookdescribesgenericC++,soitisn'tdependentupon
aparticularimplementation.
ThecontentstracktheISO/ANSIC++standards
committee'sworkandincludediscussionsoftemplates,the
StandardTemplateLibrary,thestringclass,exceptions,
RTTI,andnamespaces.
Itdoesn'tassumepriorknowledgeofC,soitcanbeused
withoutaCprerequisite.(Someprogrammingbackground
isdesirable,however.)
Topicsarearrangedsothattheearlychapterscanbe
coveredrapidlyasreviewchaptersforcoursesthatdohave
aCprerequisite.
Chaptershavereviewquestionsandprogramming
exercises.
Thebookintroducesseveraltopicsappropriateforcomputer
sciencecourses,includingabstractdatatypes,stacks,
queues,simplelists,simulations,genericprogramming,and
usingrecursiontoimplementadivide-and-conquer
strategy.
Mostchaptersareshortenoughtocoverinaweekorless.


Thebookdiscusseswhentousecertainfeaturesaswellas
howtousethem.Forexample,itlinkspublicinheritanceto
is-arelationshipsandcompositionandprivateinheritanceto

has-arelationships,anditdiscusseswhentousevirtual
functionsandwhennotto.


HowThisBookIsOrganized
Thisbookisdividedinto17chaptersand10appendixes
summarizedhere.
Chapter1:GettingStarted
ThischapterrelateshowBjarneStroustrupcreatedtheC++
programminglanguagebyaddingobject-orientedprogramming
supporttotheClanguage.You'lllearnthedistinctionsbetween
procedurallanguages,suchasC,andobject-oriented
languages,suchasC++.You'llreadaboutthejointANSI/ISO
worktodevelopaC++standard.Thechapterdiscussesthe
mechanicsofcreatingaC++program,outliningtheapproach
forseveralcurrentC++compilers.Finally,itdescribesthe
conventionsusedinthisbook.
Chapter2:SettingOuttoC++
Chapter2guidesyouthroughtheprocessofcreatingsimple
C++programs.You'lllearnabouttheroleofthemain()
functionandaboutsomeofthekindsofstatementsthatC++
programsuse.You'llusethepredefinedcoutandcinobjects
forprogramoutputandinput,andyou'lllearnaboutcreating
andusingvariables.Finally,you'llbeintroducedtofunctions,
C++'sprogrammingmodules.
Chapter3:DealingwithData
C++providesbuilt-intypesforstoringtwokindsofdata:
integers(numberswithnofractionalparts)andfloating-point
numbers(numberswithfractionalparts).Tomeetthediverse
requirementsofprogrammers,C++offersseveraltypesineach

category.Thischapterdiscussesthesetypes,includingcreating
variablesandwritingconstantsofvarioustypes.You'llalso
learnhowC++handlesimplicitandexplicitconversionsfrom


onetypetoanother.
Chapter4:CompoundTypes
C++letsyouconstructmoreelaboratetypesfromthebasic
built-intypes.Themostadvancedformistheclass,discussed
inChapters10,11,12,13and14.Thischapterdiscussesother
forms,includingarrays,whichholdseveralvaluesofasingle
type;structures,whichholdseveralvaluesofunliketypes;and
pointers,whichidentifylocationsinmemory.You'llalsolearn
howtocreateandstoretextstringsandtohandletextinput
andoutput.Finally,you'lllearnsomeofthewaysC++handles
memoryallocation,includingthenewanddeleteoperatorsfor
managingmemoryexplicitly.
Chapter5:LoopsandRelationalExpressions
Programsoftenmustperformrepetitiveactions,andC++
providesthreeloopingstructuresforthatpurpose:thefor
loop,thewhileloop,andthedowhileloop.Suchloopsmust
knowwhentheyshouldterminate,andtheC++relational
operatorsenableyoutocreateteststoguidesuchloops.You'll
alsolearnhowtocreateloopsthatreadandprocessinput
character-by-character.Finally,you'lllearnhowtocreatetwodimensionalarraysandhowtousenestedloopstoprocess
them.
Chapter6:BranchingStatementsandLogicalOperators
Programscanbehaveintelligentlyiftheycantailortheir
behaviortocircumstances.Inthischapteryou'lllearnhowto
controlprogramflowbyusingtheif,ifelse,andswitch

statementsandtheconditionaloperator.You'lllearnhowtouse
logicaloperatorstohelpexpressdecision-makingtests.Also,
you'llmeetthecctypelibraryoffunctionsforevaluating
characterrelations,suchastestingwhetheracharacterisa
digitoranonprintingcharacter.


Chapter7:FunctionsC++'sProgrammingModules
FunctionsarethebasicbuildingblocksofC++programming.
ThischapterconcentratesonfeaturesthatC++functionsshare
withCfunctions.Inparticular,you'llreviewthegeneralformat
ofafunctiondefinitionandexaminehowfunctionprototypes
increasethereliabilityofprograms.Also,you'llinvestigatehow
towritefunctionstoprocessarrays,characterstrings,and
structures.Nextyou'lllearnaboutrecursion,whichiswhena
functioncallsitself,andseehowitcanbeusedtoimplementa
divide-and-conquerstrategy.Finally,you'llmeetpointersto
functions,whichenableyoutouseafunctionargumenttotell
onefunctiontouseasecondfunction.
Chapter8:AdventuresinFunctions
ThischapterexploresthenewfeaturesC++addstofunctions.
You'lllearnaboutinlinefunctions,whichcanspeedprogram
executionatthecostofadditionalprogramsize.You'llwork
withreferencevariables,whichprovideanalternativewayto
passinformationtofunctions.Defaultargumentsletafunction
automaticallysupplyvaluesforfunctionargumentsthatyou
omitfromafunctioncall.Functionoverloadingletsyoucreate
functionshavingthesamenamebuttakingdifferentargument
lists.Allthesefeatureshavefrequentuseinclassdesign.Also,
you'lllearnaboutfunctiontemplates,whichallowyoutospecify

thedesignofafamilyofrelatedfunctions.
Chapter9:MemoryModelsandNamespaces
Thischapterdiscussesputtingtogethermultifileprograms.It
examinesyourchoicesinallocatingmemory,lookingatdifferent
methodsofmanagingmemoryandatscope,linkage,and
namespaces,whichdeterminewhatpartsofaprogramknow
aboutavariable.
Chapter10:ObjectsandClasses


Aclassisauser-definedtype,andanobjectisaninstanceofa
class,suchasavariable.Thischapterintroducesyoutoobjectorientedprogrammingandtoclassdesign.Aclassdeclaration
describestheinformationstoredinaclassobjectandalsothe
operations(classmethods)allowedforclassobjects.Some
partsofanobjectarevisibletotheoutsideworld(thepublic
portion),andsomearehidden(theprivateportion).Special
classmethods(constructorsanddestructors)comeintoplay
whenobjectsarecreatedanddestroyed.Youwilllearnaboutall
thisandotherclassdetailsinthischapter,andyou'llseehow
classescanbeusedtoimplementabstractdatatypes(ADTs),
suchasastack.
Chapter11:WorkingwithClasses
Inthischapteryou'llfurtheryourunderstandingofclasses.First
you'lllearnaboutoperatoroverloading,whichletsyoudefine
howoperatorssuchas+willworkwithclassobjects.You'lllearn
aboutfriendfunctions,whichcanaccessclassdatathat's
inaccessibletotheworldatlarge.You'llseehowcertain
constructorsandoverloadedoperatormemberfunctionscanbe
usedtomanageconversiontoandfromclasstypes.
Chapter12:ClassesandDynamicMemoryAllocation

Oftenit'susefultohaveaclassmemberpointtodynamically
allocatedmemory.Ifyouusenewinaclassconstructorto
allocatedynamicmemory,youincurtheresponsibilitiesof
providinganappropriatedestructor,ofdefininganexplicitcopy
constructor,andofdefininganexplicitassignmentoperator.
Thischaptershowsyouhowanddiscussesthebehaviorofthe
memberfunctionsgeneratedimplicitlyifyoufailtoprovide
explicitdefinitions.You'llalsoexpandyourexperiencewith
classesbyusingpointerstoobjectsandstudyingaqueue
simulationproblem.
Chapter13:ClassInheritance


Oneofthemostpowerfulfeaturesofobject-oriented
programmingisinheritance,bywhichaderivedclassinherits
thefeaturesofabaseclass,enablingyoutoreusethebase
classcode.Thischapterdiscussespublicinheritance,which
modelsis-arelationships,meaningthataderivedobjectisa
specialcaseofabaseobject.Forexample,aphysicistisa
specialcaseofascientist.Someinheritancerelationshipsare
polymorphic,meaningyoucanwritecodeusingamixtureof
relatedclassesforwhichthesamemethodnamemayinvoke
behaviorthatdependsupontheobjecttype.Implementingthis
kindofbehaviornecessitatesusinganewkindofmember
functioncalledavirtualfunction.Sometimesabstractbase
classesarethebestapproachtoinheritancerelationships.This
chapterdiscussesthesematters,pointingoutwhenpublic
inheritanceisappropriateandwhenitisnot.
Chapter14:ReusingCodeinC++
Publicinheritanceisjustonewaytoreusecode.Thischapter

looksatseveralotherways.Containmentiswhenoneclass
containsmembersthatareobjectsofanotherclass.Itcanbe
usedtomodelhas-arelationships,inwhichoneclasshas
componentsofanotherclass.Forexample,anautomobilehasa
motor.Youalsocanuseprivateandprotectedinheritanceto
modelsuchrelationships.Thischaptershowsyouhowand
pointsoutthedifferencesamongthedifferentapproaches.Also,
you'lllearnaboutclasstemplates,whichletyoudefineaclass
intermsofsomeunspecifiedgenerictype,thenusethe
templatetocreatespecificclassesintermsofspecifictypes.For
example,astacktemplateenablesyoutocreateastackof
integersorastackofstrings.Finally,you'lllearnaboutmultiple
publicinheritance,wherebyaclasscanderivefrommorethan
oneclass.
Chapter15:Friends,Exceptions,andMore
Thischapterextendsthediscussionoffriendstoincludefriend
classesandfriendmemberfunctions.Thenitpresentsseveral


newdevelopmentsinC++,beginningwithexceptions,which
provideamechanismfordealingwithunusualprogram
occurrences,suchaninappropriatefunctionargumentvaluesor
runningoutofmemory.Thenyou'lllearnaboutRTTI(runtime
typeinformation),amechanismforidentifyingobjecttypes.
Finally,you'lllearnaboutthesaferalternativestounrestricted
typecasting.
Chapter16:ThestringClassandtheStandardTemplate
Library
Thischapterdiscussessomeusefulclasslibrariesrecently
addedtothelanguage.Thestringclassisaconvenientand

powerfulalternativetotraditionalC-stylestrings.Theauto_ptr
classhelpsmanagedynamicallyallocatedmemory.The
StandardTemplateLibrary(STL)providesseveralgeneric
containers,includingtemplaterepresentationsofarrays,
queues,lists,sets,andmaps.Italsoprovidesanefficient
libraryofgenericalgorithmsthatcanbeusedwithSTL
containersandalsowithordinaryarrays.
Chapter17:Input,Output,andFiles
ThischapterreviewsC++I/Oanddiscusseshowtoformat
output.You'lllearnhowtouseclassmethodstodeterminethe
stateofaninputoroutputstreamandtosee,forexample,if
therehasbeenatypemismatchoninputorifend-of-filehas
beendetected.C++usesinheritancetoderiveclassesfor
managingfileinputandoutput.You'lllearnhowtoopenfilesfor
inputandoutput,howtoappenddatatoafile,howtouse
binaryfiles,andhowtogetrandomaccesstoafile.Finally,
you'lllearnhowtoapplystandardI/Omethodstoreadfrom
andwritetostrings.
AppendixA:NumberBases
Thisappendixdiscussesoctal,hexadecimal,andbinary
numbers.


AppendixB:C++Keywords
ThisappendixlistsC++keywords.
AppendixC:TheASCIICharacterSet
ThisappendixliststheASCIIcharactersetalongwithdecimal,
octal,hexadecimal,andbinaryrepresentations.
AppendixD:OperatorPrecedence
ThisappendixliststheC++operatorsinorderofdecreasing

precedence.
AppendixE:OtherOperators
ThisappendixsummarizesthoseC++operators,suchasthe
bitwiseoperators,notcoveredinthemainbodyofthetext.
AppendixF:ThestringTemplateClass
Thisappendixsummarizesstringclassmethodsandfunctions.
AppendixG:TheSTLMethodsandFunctions
ThisappendixsummarizestheSTLcontainermethodsandthe
generalSTLalgorithmfunctions.
AppendixH:SelectedReadings
Thisappendixlistssomebooksthatcanfurtheryour
understandingofC++.
AppendixI:ConvertingtoANSI/ISOStandardC++
ThisappendixprovidesguidelinesformovingfromCandolder
C++implementationstoStandardC++.
AppendixJ:AnswerstoReviewQuestions


×