出版时间:2013-6 出版社:机械工业出版社 作者:(美)Y. Daniel Liang
内容概要
本书保持了Liang博士系列丛书中一贯的标志性的教与学的哲学:以实例教,由实践学。通过使用他所提出的已经经过实践检验的“基础先行”的方法,Liang博士在本书中通过大量实例阐明了基本的C++特性,使得学生可以通过实践来更有效地进行学习。
在引入面向对象程序设计思想之前,Liang博士使用清晰简明的语言介绍了C++语言的基础概念和基本的程序设计技术,如循环、逐步求精等。这些概念都是使用简短且吸引人的实例来进行阐明的。他还在实例研究中给出了一些较大规模的例子,对这些实例,进行了整体的分析讨论和详细的逐行注解。
本书可以帮助学生循序渐进地学习所有必须和重要的基本概念,然后再进入到面向对象程序设计方法的学习,最终掌握构建具有异常处理和输入输出功能的有意义的应用程序的方法。贯穿全书的实例和练习都以问题求解为中心,试图培养学生开发可重用组件并创建实际项目的意识。
本书特色
更新了书中的实例和练习,以激发读者的编程兴趣。
第4章介绍了string类型和简单输入/输出,可以使读者较早使用字符串和文件编写程序。
第6章介绍函数,涵盖了所有与函数相关的问题。
常见错误和陷阱部分可以帮助读者避免常见编程错误。
扩充了算法技术方面的内容,采用新的实例详细阐释动态规划算法、分治策略、回溯法和贪婪算法以设计高效算法。
介绍了foreach循环和自动化类型参考等新的C++ 11特性。
作者简介
作者:(美)梁勇
书籍目录
Chapter1IntroductiontoComputers,Programs,andC++1.1introduction1.2WhatisaComputer?1.3ProgrammingLanguages1.4OperatingSystems1.5HistoryofC++1.6ASimpleC++Program1.7C++Program-Developmentcycle1.8ProgrammingStyleandDocumentation1.9ProgrammingErrorsChapter2ElementaryProgramming2.1Introduction2.2WritingaSimpleProgram2.3ReadingInputfromtheKeyboard2.4Identifiers2.5Variables2.6AssignmentStatementsandAssignmentExpressions2.7NamedConstants2,8NumericDataTypesandOperations2.9EvaluatingExpressionsandOperatorPrecedence2.10CaseStudy:DisplayingtheCurrentTime2,11AugmentedAssignmentOperators2.12IncrementandDecrementOperators2.13NumericTypeConversions2.14SoftwareDevelopmentProcess2.15CaseStudy:CountingMonetaryUnits2.16CommonErrorsChapter3Selections3,1Introduction3.2Theboo]DataType3.3ifStatements3,4Two-Wayif-elseStatements3,5NestedifandMulti-Wayif-elseStatements3.6CommonErrorsandPitfalls3.7CaseStudy:ComputingBodyMassIndex3.8CaseStudy:ComputingTaxes3.9GeneratingRandomNumbers3.10LogicalOperators3.11CaseStudy:DeterminingLeapYear3.12CaseStudy:Lottery3.13switchStatements3.14ConditionalExpressions3.15OperatorPrecedenceandAssociativity3.16DebuggingChapter4MathematicalFunctions,Characters,andStrings4.1Introduction4.2MathematicalFunctions4.3CharacterDataTypeandOperations4.4CaseStudy:GeneratingRandomCharacters4.5CaseStudy:GuessingBirthdays4.6CharacterFunctions4.7CaseStudy:ConvertingaHexadecimalDigittoaDecimalValue4.8ThestringType4.9CaseStudy:RevisingtheLotteryProgramUsingStrings4.10FormattingConsoleOutput4.11SimpleFileInputandOutputChapter5Loops5.1Introduction5.2ThewhileLoop5.3Thedo-whileLoop5.4TheforLoop5.5WhichLooptoUse?5.6NestedLoops5.7MinimizingNumericErrors5.8CaseStudies5.9Keywordsbreakandcontinue5.10CaseStudy:CheckingPalindromes5.11CaseStudy:DisplayingPrimeNumbersChapter6Functions6.1Introduction6.2DefiningaFunction6.3CallingaFunction6.4voidFunctions6.5PassingArgumentsbyValue6.6ModularizingCode6.7OverloadingFunctions6.8FunctionPrototypes6.9DefaultArguments6.10InlineFunctions6.11Local,Global,andStaticLocalVariables6.12PassingArgumentsbyReference6.13ConstantReferenceParameters6.14CaseStudy:ConvertingHexadecimalstoDecimals6.15FunctionAbstractionandStepwiseRefinementChapter7Single-DimensionalArraysandC-Strings7.1Introduction7.2ArrayBasics7.3Problem:LottoNumbers.7.4Problem:DeckofCards7.5PassingArraystoFunctions7.6PreventingChangesofArrayArgumentsinFunctions7.7ReturningArraysfromFunctions7.8Problem:CountingtheOccurrencesofEachLetter7.9SearchingArrays7.10SortingArrays7.11C-StringsChapter8MultidimensionalArrays8.1Introduction8.2DeclaringTwo-DimensionalArrays8.3ProcessingTwo-DimensionalArrays8.4PassingTwo-DimensionalArraystoFunctions8.5Problem:GradingaMultiple-ChoiceTest8.6Problem:FindingaClosestPair8.7Problem:Sudoku8.8MultidimensionalArraysChapter9ObjectsandClasses9.1Introduction9.2DefiningClassesforObjects9.3Example:DefiningClassesandCreatingObjects9.4Constructors9.5ConstructingandUsingObjects9.6SeparatingClassDefinitionfromImplementation9.1PreventingMultipleInclusions9.8InlineFunctionsinClasses9.9DataFieldEncapsulation9.10TheScopeofVariables9.11ClassAbstractionandEncapsulationChapter10Object-OrientedThinking10.1Introduction10.2ThestringClass10.3PassingObjectstoFunctions10.4ArrayofObjects10.5InstanceandStaticMembers10.6ConstantMemberFunctionsI0.7ThinkinginObjects10.8ObjectComposition10.9CaseStudy:TheStackOfIntegersClass10.10ClassDesignGuidelinesChapterHPointersandDynamicMemoryManagement11.1Introduction11.2PointerBasics11.3DefiningSynonymousTypesUsingthetypedefKeyword11.4UsingconstwithPointers11.5ArraysandPointers11.6PassingPointerArgumentsinaFunctionCall11.7ReturningaPointerfromFunctions11.8UsefulArrayFunctions11.9DynamicPersistentMemoryAllocation1.10CreatingandAccessingDynamicObjects1.11ThethisPointer1.12Destructors1.13CaseStudy:TheCourseClass1.14CopyConstructors1.15CustomizingCopyConstructorsChapter12Templates,Vectors,andStacks12.1Introduction12.2TemplatesBasics12.3Example:AGenericSort12.4ClassTemplates12.5ImprovingtheStackClass12.6TheC++vectorClass12.7ReplacingArraysUsingthevectorClass12.8CaseStudy:EvaluatingExpressionsChapter13FileInputandOutput13.1Introduction13.2TextI/O13.3FormattingOutput13.4Functions:getline,get,andput13.5fstreamandFileOpenModes13.6TestingStreamStates13.7BinaryIIO13.8RandomAccessFile13.9UpdatingFilesChapter14OperatorOverloading14.1Introduction14.2TheRationalClass14.3OperatorFunctions14.4OverloadingtheSubscriptOperator[]14.5OverloadingAugmentedAssignmentOperators14.6OverloadingtheUnaryOperators14.7Overloadingthe++and--Operators14.8friendFunctionsandfriendClasses14.9Overloadingthe<<and>>Operators14.10AutomaticTypeConversions14.11DefiningNonmemberFunctionsforOverloadingOperators14.12TheRationalClasswithOverloadedFunctionOperators14.13Overloadingthe=OperatorsChapter15InheritanceandPolymorphism15.1Introduction15.2BaseClassesandDerivedClasses15.3GenericProgramming15.4ConstructorsandDestructors15.5RedefiningFunctions15.6Polymorphism15.7VirtualFunctionsandDynamicBinding15.8TheprotectedKeyword15.9AbstractClassesandPureVirtualFunctions15.10Casting:staticcastversusdynamic_castChapter16ExceptionHandling16.1Introduction16.2Exception-HandlingOverview16.3Exception-HandlingAdvantages16.4ExceptionClasses16.5CustomExceptionClasses16.6MultipleCatches16.7ExceptionPropagation16.8RethrowingExceptions16.9ExceptionSpecification16.10When'toUseExceptionsChapter17Recursion.17.1Introduction17.2Example:Factorials17.3CaseStudy:FibonacciNumbers17.4ProblemSolvingUsingRecursion17.5RecursiveHelperFunctions17.6TowersofHanoi17.7EightQueens17.8RecursionversusIteration17.9TailRecursionThefollowingbonuschaptersareonthebook'sCompanionWebsiteatwww.pearsonhighered.com/liang.Chapter18DevdopingEfficientAlgorithmsChapter19SortingChapter20LinkedLists,Queues,andPriorityQueuesChapter21BinarySearchTreesChapter22STLContainersChapter23STLAlgorithmsChapter24GraphsandApplicationsChapter25WeightedGraphsandApplicationsChapter26AVLTreesandSplayTreesAPPENDIXESAppendixAC++KeywordsAppendixBTheASCIICharacterSetAppendixCOperatorPrecedenceChartAppendixDNumberSystemsAppendixEBitwiseOperationsINDEXCREDIT
图书封面
评论、评分、阅读与下载