0%

Book Description

In C++20 for Programmers, the Deitels bring their proven Live Code approach to teaching today's powerful new version of the C++ language. Like all Deitel Developer titles, they teach the best way possible: via hundreds of complete example C++ programs, with thousands of lines of downloadable C++ source code.

C++20 for Programmers is an introductory-through-intermediate-level, tutorial presentation of computer programming in the latest version (C++20) of the C++ programming language, which is popular for developing systems software, embedded systems programming, operating systems, real-time systems, communications systems and other high-performance computer applications. Ideal for anyone who's worked with at least one programming language before, C++20 for Programmers utilizes a proven "early objects" approach, emphasizing program clarity, software reuse, and component-oriented software construction. In addition to the core language, it will help you take advantage of the newest standard libraries and the newest language extensions.

Table of Contents

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. Contents
  5. Table of Contents
  6. Preface
  7. Part 1: C++ Fundamentals Quickstart
    1. Chapter 1. Introduction and Test-Driving a C++ Application
      1. 1.1 Introduction
      2. 1.2 Test-Driving a C++20 Application
    2. Chapter 2. Introduction to C++ Programming
      1. 2.1 Introduction
      2. 2.2 First Program in C++: Displaying a Line of Text
      3. 2.3 Modifying Our First C++ Program
      4. 2.4 Another C++ Program: Adding Integers
      5. 2.5 Arithmetic
      6. 2.6 Decision Making: Equality and Relational Operators
      7. 2.7 Objects Natural: Creating and Using Objects of Standard Library Class string
      8. 2.8 Wrap-Up
    3. Chapter 3. Control Statements, Part 1; Intro to C++20 Text Formatting
      1. 3.1 Introduction
      2. 3.2 Control Structures
      3. 3.3 if Single-Selection Statement
      4. 3.4 if…else Double-Selection Statement
      5. 3.5 while Iteration Statement
      6. 3.6 Counter-Controlled Iteration
      7. 3.7 Sentinel-Controlled Iteration
      8. 3.8 Nested Control Statements
      9. 3.9 Compound Assignment Operators
      10. 3.10 Increment and Decrement Operators
      11. 3.11 Fundamental Types Are Not Portable
      12. 3.12 Objects Natural Case Study: Arbitrary Sized Integers
      13. 3.13 C++20 Feature Mock-Up—Text Formatting with Function format
      14. 3.14 Wrap-Up
    4. Chapter 4. Control Statements, Part 2
      1. 4.1 Introduction
      2. 4.2 Essentials of Counter-Controlled Iteration
      3. 4.3 for Iteration Statement
      4. 4.4 Examples Using the for Statement
      5. 4.5 Application: Summing Even Integers
      6. 4.6 Application: Compound-Interest Calculations
      7. 4.7 do…while Iteration Statement
      8. 4.8 switch Multiple-Selection Statement
      9. 4.9 C++17: Selection Statements with Initializers
      10. 4.10 break and continue Statements
      11. 4.11 Logical Operators
      12. 4.12 Confusing the Equality (==) and Assignment (=) Operators
      13. 4.13 C++20 Feature Mock-Up: [[likely]] and [[unlikely]] Attributes
      14. 4.14 Objects Natural Case Study: Using the miniz-cpp Library to Write and Read ZIP files
      15. 4.15 C++20 Feature Mock-Up: Text Formatting with Field Widths and Precisions
      16. 4.16 Wrap-Up
    5. Chapter 5. Functions
      1. 5.1 Introduction
      2. 5.2 Program Components in C++
      3. 5.3 Math Library Functions
      4. 5.4 Function Definitions and Function Prototypes
      5. 5.5 Order of Evaluation of a Function’s Arguments
      6. 5.6 Function-Prototype and Argument-Coercion Notes
      7. 5.7 C++ Standard Library Headers
      8. 5.8 Case Study: Random-Number Generation
      9. 5.9 Case Study: Game of Chance; Introducing Scoped enums
      10. 5.10 C++11’s More Secure Nondeterministic Random Numbers
      11. 5.11 Scope Rules
      12. 5.12 Inline Functions
      13. 5.13 References and Reference Parameters
      14. 5.14 Default Arguments
      15. 5.15 Unary Scope Resolution Operator
      16. 5.16 Function Overloading
      17. 5.17 Function Templates
      18. 5.18 Recursion
      19. 5.19 Example Using Recursion: Fibonacci Series
      20. 5.20 Recursion vs. Iteration
      21. 5.21 C++17 and C++20: [[nodiscard]] Attribute
      22. 5.22 Lnfylun Lhqtomh Wjtz Qarcv: Qjwazkrplm xzz Xndmwwqhlz
      23. 5.23 Wrap-Up
  8. Part 2: Arrays, Pointers, Strings and Files
    1. Chapter 6. arrays, vectors, C++20 Ranges and Functional-Style Programming
      1. 6.1 Introduction
      2. 6.2 arrays
      3. 6.3 Declaring arrays
      4. 6.4 Initializing array Elements in a Loop
      5. 6.5 Initializing an array with an Initializer List
      6. 6.6 C++1 1 Range-Based for and C++20 Range-Based for with Initializer
      7. 6.7 Setting array Elements with Calculations; Introducing constexpr
      8. 6.8 Totaling array Elements
      9. 6.9 Using a Primitive Bar Chart to Display array Data Graphically
      10. 6.10 Using array Elements as Counters
      11. 6.11 Using arrays to Summarize Survey Results
      12. 6.12 Sorting and Searching arrays
      13. 6.13 Multidimensional arrays
      14. 6.14 Intro to Functional-Style Programming
      15. 6.15 Objects Natural Case Study: C++ Standard Library Class Template vector
      16. 6.16 Wrap-Up
    2. Chapter 7. (Downplaying) Pointers in Modern C++
      1. 7.1 Introduction
      2. 7.2 Pointer Variable Declarations and Initialization
      3. 7.3 Pointer Operators
      4. 7.4 Pass-by-Reference with Pointers
      5. 7.5 Built-In Arrays
      6. 7.6 C++20: Using to_array to convert a Built-in Array to a std::array
      7. 7.7 Using const with Pointers and the Data They Point To
      8. 7.8 sizeof Operator
      9. 7.9 Pointer Expressions and Pointer Arithmetic
      10. 7.10 Objects Natural Case Study: C++20 spans—Views of Contiguous Container Elements
      11. 7.11 A Brief Intro to Pointer-Based Strings
      12. 7.12 Looking Ahead to Other Pointer Topics
      13. 7.13 Wrap-Up
    3. Chapter 8. strings, string_views, Text Files, CSV Files and Regex
      1. 8.1 Introduction
      2. 8.2 string Assignment and Concatenation
      3. 8.3 Comparing strings
      4. 8.4 Substrings
      5. 8.5 Swapping strings
      6. 8.6 string Characteristics
      7. 8.7 Finding Substrings and Characters in a string
      8. 8.8 Replacing Characters in a string
      9. 8.9 Inserting Characters into a string
      10. 8.10 C++11 Numeric Conversions
      11. 8.11 C++17 string_view
      12. 8.12 Files and Streams
      13. 8.13 Creating a Sequential File
      14. 8.14 Reading Data from a Sequential File
      15. 8.15 C++14 Reading and Writing Quoted Text
      16. 8.16 Updating Sequential Files
      17. 8.17 String Stream Processing
      18. 8.18 Raw String Literals
      19. 8.19 Objects Natural Case Study: Reading and Analyzing a CSV File Containing Titanic Disaster Data
      20. 8.20 Objects Natural Case Study: Introduction to Regular Expressions
      21. 8.21 Wrap-Up
  9. Part 3: Object-Oriented Programming
    1. Chapter 9. Custom Classes
      1. 9.1 Introduction
      2. 9.2 Test-Driving an Account Object
      3. 9.3 Account Class with a Data Member and Set and Get Member Functions
      4. 9.4 Account Class: Custom Constructors
      5. 9.5 Software Engineering with Set and Get Member Functions
      6. 9.6 Account Class with a Balance
      7. 9.7 Time Class Case Study: Separating Interface from Implementation
      8. 9.8 Compilation and Linking Process
      9. 9.9 Class Scope and Accessing Class Members
      10. 9.10 Access Functions and Utility Functions
      11. 9.11 Time Class Case Study: Constructors with Default Arguments
      12. 9.12 Destructors
      13. 9.13 When Constructors and Destructors Are Called
      14. 9.14 Time Class Case Study: A Subtle Trap—Returning a Reference or a Pointer to a private Data Member
      15. 9.15 Default Assignment Operator
      16. 9.16 const Objects and const Member Functions
      17. 9.17 Composition: Objects as Members of Classes
      18. 9.18 friend Functions and friend Classes
      19. 9.19 The this Pointer
      20. 9.20 static Class Members—Classwide Data and Member Functions
      21. 9.21 Aggregates in C++20
      22. 9.22 Objects Natural Case Study: Serialization with JSON
      23. 9.23 Wrap-Up
    2. Chapter 10. Inheritance and Polymorphism [This content is currently in development.]
    3. Chapter 11. Operator Overloading [This content is currently in development.]
    4. Chapter 12. Exceptions: A Deeper Look [This content is currently in development.]
  10. Part 4: Standard Library Containers, Iterators and Algorithms
    1. Chapter 13. Standard Library Containers and Iterators [This content is currently in development.]
    2. Chapter 14. Standard Library Algorithms; Functional Programming: A Deeper Look [This content is currently in development.]
  11. Part 5: Advanced Topics
    1. Chapter 15. C++20 Modules [This content is currently in development.]
    2. Chapter 16. Intro to Custom Templates and C++20 Concepts [This content is currently in development.]
    3. Chapter 17. Concurrent Programming; Intro to C++20 Coroutines [This content is currently in development.]
  12. Part 6: Other Topics
    1. Chapter 18. Stream I/O; C++20 Text Formatting: A Deeper Look [This content is currently in development.]
    2. Chapter 19. Other Topics; A Look Toward C++23 and Contracts [This content is currently in development.]
  13. Part 7: Appendices
    1. Appendix A. Operator Precedence and Grouping [This content is currently in development.]
    2. Appendix B. Character Set [This content is currently in development.]
    3. Appendix C. Fundamental Types [This content is currently in development.]
    4. Appendix D. Number Systems [This content is currently in development.]
    5. Appendix E. Preprocessor [This content is currently in development.]
    6. Appendix F. Bits, Characters, C Strings and structs [This content is currently in development.]
    7. Appendix G. C Legacy Code Topics [This content is currently in development.]
    8. Appendix H. Using the Visual Studio Debugger [This content is currently in development.]
    9. Appendix I. Using the GNU C++ Debugger [This content is currently in development.]
    10. Appendix J. Using the Xcode Debugger [This content is currently in development.]
  14. Code Snippets
44.202.198.173