ebook img

Malik, D: C++ Programming PDF

1731 Pages·2014·25.094 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Malik, D: C++ Programming

C8649_FM Buy. Rent. Access. Access student data fi les and other study tools on cengagebrain.com. For detailed instructions visit http://solutions.cengage.com/ctdownloads/ Store your Data Files on a USB drive for maximum effi ciency in organizing and working with the fi les. Macintosh users should use a program to expand WinZip or PKZip archives. Ask your instructor or lab coordinator for assistance. Copyright 2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it. C8649_FM C++ P : ROGRAMMING P D I D S ROGRAM ESIGN NCLUDING ATA TRUCTURES S E EVENTH DITION D.S. M ALIK Australia(cid:2)Brazil(cid:2)Japan(cid:2)Korea(cid:2)Mexico(cid:2)Singapore(cid:2)Spain(cid:2)UnitedKingdom(cid:2)UnitedStates Copyright 2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it. C8649_FM This is an electronic version of the print textbook. Due to electronic rights restrictions, some third party content may be suppressed. Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. The publisher reserves the right to remove content from this title at any time if subsequent rights restrictions require it. For valuable information on pricing, previous editions, changes to current editions, and alternate formats, please visit www.cengage.com/highered to search by ISBN#, author, title, or keyword for materials in your areas of interest. Copyright 2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it. C8649_FM C++Programming:ProgramDesign ª CengageLearning IncludingDataStructures,SeventhEdition WCN: 02-200-203 D.S.Malik ALLRIGHTSRESERVED.Nopartofthisworkcoveredbythecopyright hereinmaybereproduced,transmitted,storedorusedinanyformorby ProductDirector:KathleenMcMahon anymeans—graphic,electronic,ormechanical,includingbutnotlimited SeniorProductManager:JimGish tophotocopying,recording,scanning,digitizing,taping,Webdistribution, SeniorContentDeveloper:AlyssaPratt informationnetworks,orinformationstorageandretrievalsystems, exceptaspermittedunderSection or ofthe UnitedStates ProductAssistant:GillianDaniels CopyrightAct—withoutthepriorwrittenpermissionofthepublisher. ContentProjectManager:Jennifer Feltri-George Forproductinformationandtechnologyassistance,contactusat ArtDirector:GEXPublishingServices CengageLearningCustomer&SalesSupport,www.cengage.com/ PrintBuyer:JulioEsperas support. Forpermissiontousematerialfromthistextorproduct, CoverDesigner:GEXPublishingServices submitallrequestsonlineatwww.cengage.com/permissions. CoverPhoto:ªOlegDoroshin/Shutterstock.com Furtherpermissionsquestionscanbeemailedto Proofreader:AndreaSchein [email protected]. Indexer:SharonHilgenberg LibraryofCongressControlNumber: Compositor:IntegraSoftwareServices ISBN- : -- - - CengageLearning FirstStamfordPlace,4thFloor Stamford,CT USA CengageLearningisaleadingproviderofcustomizedlearningsolutions withofficelocationsaroundtheglobe,includingSingapore,theUnited Kingdom,Australia,Mexico,Brazil,andJapan.Locateyourlocaloffice at:www.cengage.com/global CengageLearningproductsarerepresentedinCanadabyNelson Education,Ltd. Purchaseanyofourproductsatyourlocalcollegestoreoratour preferredonlinestore:www.cengagebrain.com Someoftheproductnamesandcompanynamesusedinthisbookhave beenusedforidentificationpurposesonlyandmaybetrademarksor registeredtrademarksoftheirrespectivemanufacturersandsellers. MicrosoftproductscreenshotsusedwithpermissionfromMicrosoft Corporation. Unlessotherwisecredited,allartandtablesª2015CengageLearning, producedbyIntegra. CengageLearningreservestherighttorevisethispublicationandmake changesfromtimetotimeinitscontentwithoutnotice. AnyfictionaldatarelatedtopersonsorcompaniesorURLsused throughoutthisbookisintendedforinstructionalpurposesonly.Atthe timethisbookwasprinted,anysuchdatawasfictionalandnot belongingtoanyrealpersonsorcompanies. Theprogramsinthisbookareforinstructionalpurposesonly.Theyhave beentestedwithcare,butarenotguaranteedforanyparticularintent beyondeducationalpurposes.Theauthorandthepublisherdonotoffer anywarrantiesorrepresentations,nordotheyacceptanyliabilitieswith respecttotheprograms. PrintedintheUnitedStatesofAmerica 123456720191817161514 Copyright 2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it. C8649_FM TO My Parents Copyright 2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it. C8649_FM Copyright 2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it. C8649_FM B C RIEF ONTENTS ªHunThomas/Shutterstock.com PREFACE xxxv 1. An Overview of Computers and Programming Languages 1 2. Basic Elements of C++ 27 3. Input/Output 123 4. Control Structures I (Selection) 185 5. Control Structures II (Repetition) 263 6. User-Defined Functions 345 7. User-Defined Simple Data Types, Namespaces, and the string Type 465 8. Arrays and Strings 519 9. Records (structs) 609 10. Classes and Data Abstraction 649 11. Inheritance and Composition 737 12. Pointers, Classes, Virtual Functions, Abstract Classes, and Lists 811 13. Overloading and Templates 901 14. Exception Handling 997 15. Recursion 1039 16. Linked Lists 1071 17. Stacks and Queues 1165 18. Searching and Sorting Algorithms 1265 Copyright 2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it. C8649_FM vi | C++Programming:ProgramDesignIncludingDataStructures,SeventhEdition 19. Binary Trees 1347 20. Graphs 1403 21. Standard Template Library (STL) 1441 APPENDIX A Reserved Words 1561 APPENDIX B Operator Precedence 1563 APPENDIX C Character Sets 1565 APPENDIX D Operator Overloading 1569 APPENDIX E Additional C++ Topics 1571 APPENDIX F Header Files 1593 APPENDIX G Memory Size on a System and Random Number Generator 1603 APPENDIX H References 1605 APPENDIX I Answers to Odd-Numbered Exercises 1607 INDEX 1649 Copyright 2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it. C8649_FM T C ABLE OF ONTENTS ªHunThomas/Shutterstock.com Preface xxxv AN OVERVIEW OF COMPUTERS AND 1 PROGRAMMING LANGUAGES 1 Introduction 2 A Brief Overview of the History of Computers 2 Elements of a Computer System 3 Hardware 4 Central Processing Unit and Main Memory 4 Input/Output Devices 5 Software 5 The Language of a Computer 5 The Evolution of Programming Languages 7 Processing a C++ Program 9 Programming with the Problem Analysis–Coding–Execution Cycle 11 Programming Methodologies 20 Structured Programming 20 Object-Oriented Programming 20 ANSI/ISO Standard C++ 22 Copyright 2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.