An Introduction to Programming by the Inventor of C++ Programming: Principles and Practice Using C++, Third Edition, will help anyone who is willing to work hard learn the fundamental principles of programming and develop the practical skills needed for programming in the real world. Previous editions have been used successfully by many thousands of students. This revised and updated edition Assumes that your aim is to eventually write programs that are good enough for others to use and maintainFocuses on fundamental concepts and techniques, rather than on obscure language-technical detailsIs an introduction to programming in general, including procedural, object-oriented, and generic programming, rather than just an introduction to a programming languageCovers both contemporary high-level techniques and the lower-level techniques needed for efficient use of hardwareWill give you a solid foundation for writing useful, correct, type-safe, maintainable, and efficient codeIs primarily designed for people who have never programmed before, but even seasoned programmers have found previous editions useful as an introduction to more effective concepts and techniquesCovers a wide range of essential concepts, design and programming techniques, language features, and librariesUses contemporary C++ (C++20 and C++23)Covers the design and use of both built-in types and user-defi ned types, complete with input, output, computation, and simple graphics/GUIOffers an introduction to the C++ standard library containers and algorithms Register your book for convenient access to downloads, updates, and/or corrections as they become available. See inside book for details.
Les mer
Preface ix Chapter 0: Notes to the Reader 10.1 The structure of this book 20.2 A philosophy of teaching and learning 50.3 ISO standard C++ 80.4 PPP support 110.5 Author biography 130.6 Bibliography 13 Part I: The Basics Chapter 1: Hello, World! 171.1 Programs 181.2 The classic first program 181.3 Compilation 211.4 Linking 231.5 Programming environments 24 Chapter 2: Objects, Types, and Values 292.1 Input 302.2 Variables 322.3 Input and type 332.4 Operations and operators 342.5 Assignment and initialization 362.6 Names 402.7 Types and objects 422.8 Type safety 432.9 Conversions 442.10 Type deduction: auto 46 Chapter 3 Computation 513.1 Computation 523.2 Objectives and tools 533.3 Expressions 553.4 Statements 583.5 Functions 683.6 vector 713.7 Language features 77 Chapter 4: Errors! 834.1 Introduction 844.2 Sources of errors 854.3 Compile-time errors 864.4 Link-time errors 884.5 Run-time errors 894.6 Exceptions 944.7 Avoiding and finding errors 99 Chapter 5: Writing a Program 1155.1 A problem 1165.2 Thinking about the problem 1165.3 Back to the calculator! 1195.4 Back to the drawing board 1265.5 Turning a grammar into code 1305.6 Trying the first version 1365.7 Trying the second version 1405.8 Token streams 1425.9 Program structure 146 Chapter 6: Completing a Program 1516.1 Introduction 1526.2 Input and output 1526.3 Error handling 1546.4 Negative numbers 1566.5 Remainder: % 1576.6 Cleaning up the code 1586.7 Recovering from errors1646.8 Variables 167 Chapter 7: Technicalities: Functions, etc. 1797.1 Technicalities 1807.2 Declarations and definitions 1817.3 Scope 1867.4 Function call and return 1907.5 Order of evaluation 2067.6 Namespaces 2097.7 Modules and headers 211 Chapter 8: Technicalities: Classes, etc. 2218.1 User-defined types 2228.2 Classes and members 2238.3 Interface and implementation 2238.4 Evolving a class: Date 2258.5 Enumerations 2338.6 Operator overloading 2368.7 Class interfaces 237 Part II: Input and Output Chapter 9: Input and Output Streams 2519.1 Input and output 2529.2 The I/O stream model 2539.3 Files 2549.4 I/O error handling 2589.5 Reading a single value 2619.6 User-defined output operators 2669.7 User-defined input operators 2669.8 A standard input loop 2679.9 Reading a structured file 2699.10 Formatting 2769.11 String streams 283 Chapter 10: A Display Model 28910.1 Why graphics? 29010.2 A display model 29010.3 A first example 29210.4 Using a GUI library 29510.5 Coordinates 29610.6 Shapes 29710.7 Using Shape primitives29710.8 Getting the first example to run 309 Chapter 11: Graphics Classes 31511.1 Overview of graphics classes 31611.2 Point and Line 31711.3 Lines 32011.4 Color 32311.5 Line_style 32511.6 Polylines 32811.7 Closed shapes 33311.8 Text 34611.9 Mark 34811.10 Image 350 Chapter 12: Class Design 35512.1 Design principles 35612.2 Shape 36012.3 Base and derived classes 36712.4 Other Shape functions 37512.5 Benefits of object-oriented programming 376 Chapter 13: Graphing Functions and Data 38113.1 Introduction 38213.2 Graphing simple functions 38213.3 Function 38613.4 Axis 39013.5 Approximation 39213.6 Graphing data 397 Chapter 14: Graphical User Interfaces 40914.1 User-interface alternatives 41014.2 The “Next” button 41114.3 A simple window 41214.4 Button and other Widgets 41414.5 An example: drawing lines 41914.6 Simple animation 42614.7 Debugging GUI code 427 Part III: Data and Algorithms Chapter 15: Vector and Free Store 43515.1 Introduction 43615.2 vector basics 43715.3 Memory, addresses, and pointers 43915.4 Free store and pointers 44215.5 Destructors 44715.6 Access to elements 45115.7 An example: lists 45215.8 The this pointer 456 Chapter 16: Arrays, Pointers, and References 46316.1 Arrays 46416.2 Pointers and references46816.3 C-style strings 47116.4 Alternatives to pointer use 47216.5 An example: palindromes 475 Chapter 17: Essential Operations 48317.1 Introduction 48417.2 Access to elements 48417.3 List initialization 48617.4 Copying and moving 48817.5 Essential operations 49517.6 Other useful operations50017.7 Remaining Vector problems 50217.8 Changing size 50417.9 Our Vector so far 509 Chapter 18: Templates and Exceptions 51318.1 Templates 51418.2 Generalizing Vector 52218.3 Range checking and exceptions 52518.4 Resources and exceptions 52918.5 Resource-management pointers 537 Chapter 19: Containers and Iterators 54519.1 Storing and processing data 54619.2 Sequences and iterators55219.3 Linked lists 55519.4 Generalizing Vector yet again 56019.5 An example: a simple text editor 56619.6 vector, list, and string 572 Chapter 20: Maps and Sets 57720.1 Associative containers 57820.2 map 57820.3 unordered_map 58520.4 Timing 58620.5 set 58920.6 Container overview 59120.7 Ranges and iterators 597 Chapter 21: Algorithms 60321.1 Standard-library algorithms 60421.2 Function objects 61021.3 Numerical algorithms 61421.4 Copying 61921.5 Sorting and searching 620 Index 625
Les mer
Produktdetaljer
ISBN
9780138308681
Publisert
2024-09-09
Utgave
3. utgave
Utgiver
Vendor
Addison Wesley
Vekt
1245 gr
Høyde
231 mm
Bredde
188 mm
Dybde
29 mm
Aldersnivå
P, 06
Språk
Product language
Engelsk
Format
Product format
Heftet
Antall sider
656
Forfatter
Biographical note
Bjarne Stroustrup is the designer and original implementer of C++, as well as the author of The C++ Programming Language (4th Edition), A Tour of C++ (3rd edition), Programming: Principles and Practice Using C++ (3rd Edition), and many popular and academic publications. He is a professor of Computer Science at Columbia University in New York City. Dr. Stroustrup is a member of the US National Academy of Engineering, and an IEEE, ACM, and CHM fellow. He received the 2018 Charles Stark Draper Prize, the IEEE Computer Society's 2018 Computer Pioneer Award, and the 2017 IET Faraday Medal.