O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sams Teach Yourself C++ in One Hour a Day, Eighth Edition

Book Description

In just one hour a day, you’ll have all the skills you need to begin programming in C++. With this complete tutorial, you’ll quickly master the basics, and then move on to more advanced features and concepts. Completely updated for the C++14 standard, with a preview of C++17, this book presents the language from a practical point of view, helping you learn how to use C++ to create faster, simpler, and more efficient C++ applications.

  • Master the fundamentals of C++ and object-oriented programming

  • Understand how C++ features help you write compact and efficient code using concepts such as lambda expressions, move constructors, and assignment operators

  • Learn best practices and avoid pitfalls via useful Do’s and Don’ts 

  • Learn the Standard Template Library, including containers and algorithms used in most real-world C++ applications

  • Test your knowledge and expertise with exercises at the end of every lesson 

  • Learn on your own time, at your own pace

  • No previous programming experience required

  • Write fast and powerful C++ programs, compile the source code, and create executable files

  • Learn object-oriented programming concepts such as encapsulation, abstraction, inheritance, and polymorphism

  • Use the Standard Template Library’s algorithms and containers to write feature-rich yet stable C++ applications

  • Learn how automatic type deduction helps simplify C++ code

  • Develop sophisticated programming techniques using lambda expressions, smart pointers, and move constructors

  • Master the features of C++ by learning from programming experts

  • Learn C++ features that allow you to program compact and high-performance C++ applications

  • Preview what’s new in C++17

  • Contents at a Glance

    Part I: The Basics

    Lesson 1: Getting Started

    Lesson 2: The Anatomy of a C++ Program

    Lesson 3: Using Variables, Declaring Constants

    Lesson 4: Managing Arrays and Strings

    Lesson 5: Working with Expressions, Statements, and Operators

    Lesson 6: Controlling Program Flow

    Lesson 7: Organizing Code with Functions

    Lesson 8: Pointers and References Explained

    Part II: Fundamentals of Object-Oriented C++ Programming

    Lesson 9: Classes and Objects

    Lesson 10: Implementing Inheritance

    Lesson 11: Polymorphism

    Lesson 12: Operator Types and Operator Overloading

    Lesson 13: Casting Operators

    Lesson 14: An Introduction to Macros and Templates

    Part III: Learning the Standard Template Library (STL)

    Lesson 15: An Introduction to the Standard Template Library

    Lesson 16: The STL String Class

    Lesson 17: STL Dynamic Array Classes

    Lesson 18: STL list and forward_list

    Lesson 19: STL Set Classes 

    Lesson 20: STL Map Classes

    Part IV: More STL

    Lesson 21: Understanding Function Objects

    Lesson 22: Lambda Expressions 

    Lesson 23: STL Algorithms

    Lesson 24: Adaptive Containers: Stack and Queue

    Lesson 25: Working with Bit Flags Using STL

    Part V: Advanced C++ Concepts

    Lesson 26: Understanding Smart Pointers

    Lesson 27: Using Streams for Input and Output 

    Lesson 28: Exception Handling

    Lesson 29: Going Forward

    Part VI: Appendixes

    Appendix A: Working with Numbers: Binary and Hexadecimal

    Appendix B: C++ Keywords

    Appendix C: Operator Precedence

    Appendix D: ASCII Codes

    Appendix E: Answers

    Table of Contents

    1. About This E-Book
    2. Title Page
    3. Copyright Page
    4. Contents
    5. Dedication
    6. Acknowledgments
    7. About the Author
    8. We Want to Hear from You!
    9. Reader Services
    10. Introduction
      1. Who Should Read This Book?
      2. Organization of This Book
      3. Conventions Used in This Book
      4. Sample Code for This Book
    11. Part I: The Basics
      1. Lesson 1. Getting Started
        1. A Brief History of C++
          1. Connection to C
          2. Advantages of C++
          3. Evolution of the C++ Standard
          4. Who Uses Programs Written in C++?
        2. Programming a C++ Application
          1. Steps to Generating an Executable
          2. Analyzing Errors and “Debugging”
          3. Integrated Development Environments
          4. Programming Your First C++ Application
          5. Building and Executing Your First C++ Application
          6. Understanding Compiler Errors
        3. What’s New in C++?
        4. Summary
        5. Q&A
        6. Workshop
          1. Quiz
          2. Exercises
      2. Lesson 2. The Anatomy of a C++ Program
        1. Parts of the Hello World Program
        2. Preprocessor Directive #include
        3. The Body of Your Program main()
          1. Returning a Value
        4. The Concept of Namespaces
        5. Comments in C++ Code
        6. Functions in C++
        7. Basic Input Using std::cin and Output Using std::cout
        8. Summary
        9. Q&A
        10. Workshop
          1. Quiz
          2. Exercises
      3. Lesson 3. Using Variables, Declaring Constants
        1. What Is a Variable?
          1. Memory and Addressing in Brief
          2. Declaring Variables to Access and Use Memory
          3. Declaring and Initializing Multiple Variables of a Type
          4. Understanding the Scope of a Variable
          5. Global Variables
          6. Naming Conventions
        2. Common Compiler-Supported C++ Variable Types
          1. Using Type bool to Store Boolean Values
          2. Using Type char to Store Character Values
          3. The Concept of Signed and Unsigned Integers
          4. Signed Integer Types short, int, long, and long long
          5. Unsigned Integer Types unsigned short, unsigned int, unsigned long, and unsigned long long
          6. Avoid Overflow Errors by Selecting Correct Data Types
          7. Floating-Point Types float and double
        3. Determining the Size of a Variable Using sizeof
          1. Avoid Narrowing Conversion Errors by Using List Initialization
        4. Automatic Type Inference Using auto
        5. Using typedef to Substitute a Variable’s Type
        6. What Is a Constant?
          1. Literal Constants
          2. Declaring Variables as Constants Using const
          3. Constant Expressions Using constexpr
          4. Enumerations
          5. Defining Constants Using #define
        7. Keywords You Cannot Use as Variable or Constant Names
        8. Summary
        9. Q&A
        10. Workshop
          1. Quiz
          2. Exercises
      4. Lesson 4. Managing Arrays and Strings
        1. What Is an Array?
          1. The Need for Arrays
          2. Declaring and Initializing Static Arrays
          3. How Data Is Stored in an Array
          4. Accessing Data Stored in an Array
          5. Modifying Data Stored in an Array
        2. Multidimensional Arrays
          1. Declaring and Initializing Multidimensional Arrays
          2. Accessing Elements in a Multidimensional Array
        3. Dynamic Arrays
        4. C-style Character Strings
        5. C++ Strings: Using std::string
        6. Summary
        7. Q&A
        8. Workshop
          1. Quiz
          2. Exercises
      5. Lesson 5. Working with Expressions, Statements, and Operators
        1. Statements
        2. Compound Statements or Blocks
        3. Using Operators
          1. The Assignment Operator (=)
          2. Understanding L-values and R-values
          3. Operators to Add (+), Subtract (-), Multiply (*), Divide (/), and Modulo Divide (%)
          4. Operators to Increment (++) and Decrement (--)
          5. To Postfix or to Prefix?
          6. Equality Operators (==) and (!=)
          7. Relational Operators
          8. Logical Operations NOT, AND, OR, and XOR
          9. Using C++ Logical Operators NOT (!), AND (&&), and OR (||)
          10. Bitwise NOT (~), AND (&), OR (|), and XOR (^) Operators
          11. Bitwise Right Shift (>>) and Left Shift (<<) Operators
          12. Compound Assignment Operators
          13. Using Operator sizeof to Determine the Memory Occupied by a Variable
          14. Operator Precedence
        4. Summary
        5. Q&A
        6. Workshop
          1. Quiz
          2. Exercises
      6. Lesson 6. Controlling Program Flow
        1. Conditional Execution Using if ... else
          1. Conditional Programming Using if ... else
          2. Executing Multiple Statements Conditionally
          3. Nested if Statements
          4. Conditional Processing Using switch-case
          5. Conditional Execution Using Operator (?:)
        2. Getting Code to Execute in Loops
          1. A Rudimentary Loop Using goto
          2. The while Loop
          3. The do...while Loop
          4. The for Loop
          5. The Range-Based for Loop
        3. Modifying Loop Behavior Using continue and break
          1. Loops That Don’t End—That Is, Infinite Loops
          2. Controlling Infinite Loops
        4. Programming Nested Loops
          1. Using Nested Loops to Walk a Multidimensional Array
          2. Using Nested Loops to Calculate Fibonacci Numbers
        5. Summary
        6. Q&A
        7. Workshop
          1. Quiz
          2. Exercises
      7. Lesson 7. Organizing Code with Functions
        1. The Need for Functions
          1. What Is a Function Prototype?
          2. What Is a Function Definition?
          3. What Is a Function Call, and What Are Arguments?
          4. Programming a Function with Multiple Parameters
          5. Programming Functions with No Parameters or No Return Values
          6. Function Parameters with Default Values
          7. Recursion—Functions That Invoke Themselves
          8. Functions with Multiple Return Statements
        2. Using Functions to Work with Different Forms of Data
          1. Overloading Functions
          2. Passing an Array of Values to a Function
          3. Passing Arguments by Reference
        3. How Function Calls Are Handled by the Microprocessor
          1. Inline Functions
          2. Automatic Return Type Deduction
          3. Lambda Functions
        4. Summary
        5. Q&A
        6. Workshop
          1. Quiz
          2. Exercises
      8. Lesson 8. Pointers and References Explained
        1. What Is a Pointer?
          1. Declaring a Pointer
          2. Determining the Address of a Variable Using the Reference Operator (&)
          3. Using Pointers to Store Addresses
          4. Access Pointed Data Using the Dereference Operator (*)
          5. What Is the sizeof() of a Pointer?
        2. Dynamic Memory Allocation
          1. Using Operators new and delete to Allocate and Release Memory Dynamically
          2. Effect of Incrementing and Decrementing Operators (++ and --) on Pointers
          3. Using the const Keyword on Pointers
          4. Passing Pointers to Functions
          5. Similarities between Arrays and Pointers
        3. Common Programming Mistakes When Using Pointers
          1. Memory Leaks
          2. When Pointers Don’t Point to Valid Memory Locations
          3. Dangling Pointers (Also Called Stray or Wild Pointers)
          4. Checking Whether Allocation Request Using new Succeeded
        4. Pointer Programming Best-Practices
        5. What Is a Reference?
          1. What Makes References Useful?
          2. Using Keyword const on References
          3. Passing Arguments by Reference to Functions
        6. Summary
        7. Q&A
        8. Workshop
          1. Quiz
          2. Exercises
    12. Part II: Fundamentals of Object-Oriented C++ Programming
      1. Lesson 9. Classes and Objects
        1. The Concept of Classes and Objects
          1. Declaring a Class
          2. An Object as an Instance of a Class
          3. Accessing Members Using the Dot Operator (.)
          4. Accessing Members Using the Pointer Operator (->)
        2. Keywords public and private
          1. Abstraction of Data via Keyword private
        3. Constructors
          1. Declaring and Implementing a Constructor
          2. When and How to Use Constructors
          3. Overloading Constructors
          4. Class Without a Default Constructor
          5. Constructor Parameters with Default Values
          6. Constructors with Initialization Lists
        4. Destructor
          1. Declaring and Implementing a Destructor
          2. When and How to Use a Destructor
        5. Copy Constructor
          1. Shallow Copying and Associated Problems
          2. Ensuring Deep Copy Using a Copy Constructor
          3. Move Constructors Help Improve Performance
        6. Different Uses of Constructors and the Destructor
          1. Class That Does Not Permit Copying
          2. Singleton Class That Permits a Single Instance
          3. Class That Prohibits Instantiation on the Stack
          4. Using Constructors to Convert Types
        7. this Pointer
        8. sizeof() a Class
        9. How struct Differs from class
        10. Declaring a friend of a class
        11. union: A Special Data Storage Mechanism
          1. Declaring a Union
          2. Where Would You Use a union?
        12. Using Aggregate Initialization on Classes and Structs
          1. constexpr with Classes and Objects
        13. Summary
        14. Q&A
        15. Workshop
          1. Quiz
          2. Exercises
      2. Lesson 10. Implementing Inheritance
        1. Basics of Inheritance
          1. Inheritance and Derivation
          2. C++ Syntax of Derivation
          3. Access Specifier Keyword protected
          4. Base Class Initialization—Passing Parameters to the Base Class
          5. Derived Class Overriding Base Class’s Methods
          6. Invoking Overridden Methods of a Base Class
          7. Invoking Methods of a Base Class in a Derived Class
          8. Derived Class Hiding Base Class’s Methods
          9. Order of Construction
          10. Order of Destruction
        2. Private Inheritance
        3. Protected Inheritance
        4. The Problem of Slicing
        5. Multiple Inheritance
        6. Avoiding Inheritance Using final
        7. Summary
        8. Q&A
        9. Workshop
          1. Quiz
          2. Exercises
      3. Lesson 11. Polymorphism
        1. Basics of Polymorphism
          1. Need for Polymorphic Behavior
          2. Polymorphic Behavior Implemented Using Virtual Functions
          3. Need for Virtual Destructors
          4. How Do virtual Functions Work? Understanding the Virtual Function Table
          5. Abstract Base Classes and Pure Virtual Functions
        2. Using virtual Inheritance to Solve the Diamond Problem
        3. Specifier Override to Indicate Intention to Override
        4. Use final to Prevent Function Overriding
        5. Virtual Copy Constructors?
        6. Summary
        7. Q&A
        8. Workshop
          1. Quiz
          2. Exercises
      4. Lesson 12. Operator Types and Operator Overloading
        1. What Are Operators in C++?
        2. Unary Operators
          1. Types of Unary Operators
          2. Programming a Unary Increment/Decrement Operator
          3. Programming Conversion Operators
          4. Programming Dereference Operator (*) and Member Selection Operator (->)
        3. Binary Operators
          1. Types of Binary Operators
          2. Programming Binary Addition (a+b) and Subtraction (a-b) Operators
          3. Implementing Addition Assignment (+=) and Subtraction Assignment (-=) Operators
          4. Overloading Equality (==) and Inequality (!=) Operators
          5. Overloading <, >, <=, and >= Operators
          6. Overloading Copy Assignment Operator (=)
          7. Subscript Operator ([])
        4. Function Operator ()
        5. Move Constructor and Move Assignment Operator for High Performance Programming
          1. The Problem of Unwanted Copy Steps
          2. Declaring a Move Constructor and Move Assignment Operator
        6. User Defined Literals
        7. Operators That Cannot Be Overloaded
        8. Summary
        9. Q&A
        10. Workshop
          1. Quiz
          2. Exercises
      5. Lesson 13. Casting Operators
        1. The Need for Casting
        2. Why C-Style Casts Are Not Popular with Some C++ Programmers
        3. The C++ Casting Operators
          1. Using static_cast
          2. Using dynamic_cast and Runtime Type Identification
          3. Using reinterpret_cast
          4. Using const_cast
        4. Problems with the C++ Casting Operators
        5. Summary
        6. Q&A
        7. Workshop
          1. Quiz
          2. Exercises
      6. Lesson 14. An Introduction to Macros and Templates
        1. The Preprocessor and the Compiler
        2. Using Macro #define to Define Constants
          1. Using Macros for Protection against Multiple Inclusion
        3. Using #define to Write Macro Functions
          1. Why All the Parentheses?
          2. Using Macro assert to Validate Expressions
          3. Advantages and Disadvantages of Using Macro Functions
        4. An Introduction to Templates
          1. Template Declaration Syntax
          2. The Different Types of Template Declarations
          3. Template Functions
          4. Templates and Type Safety
          5. Template Classes
          6. Declaring Templates with Multiple Parameters
          7. Declaring Templates with Default Parameters
          8. Sample Template class<> HoldsPair
          9. Template Instantiation and Specialization
          10. Template Classes and static Members
          11. Variable Templates, Also Called Variadic Templates
          12. Using static_assert to Perform Compile-Time Checks
          13. Using Templates in Practical C++ Programming
        5. Summary
        6. Q&A
        7. Workshop
          1. Quiz
          2. Exercises
    13. Part III: Learning the Standard Template Library (STL)
      1. Lesson 15. An Introduction to the Standard Template Library
        1. STL Containers
          1. Sequential Containers
          2. Associative Containers
          3. Container Adapters
        2. STL Iterators
        3. STL Algorithms
        4. The Interaction between Containers and Algorithms Using Iterators
          1. Using Keyword auto to Let Compiler Define Type
        5. Choosing the Right Container
        6. STL String Classes
        7. Summary
        8. Q&A
        9. Workshop
          1. Quiz
      2. Lesson 16. The STL String Class
        1. The Need for String Manipulation Classes
        2. Working with the STL String Class
          1. Instantiating the STL String and Making Copies
          2. Accessing Character Contents of a std::string
          3. Concatenating One String to Another
          4. Finding a Character or Substring in a String
          5. Truncating an STL string
          6. String Reversal
          7. String Case Conversion
        3. Template-Based Implementation of an STL String
        4. C++14 operator ""s in std::string
        5. Summary
        6. Q&A
        7. Workshop
          1. Quiz
          2. Exercises
      3. Lesson 17. STL Dynamic Array Classes
        1. The Characteristics of std::vector
        2. Typical Vector Operations
          1. Instantiating a Vector
          2. Inserting Elements at the End Using push_back()
          3. List Initialization
          4. Inserting Elements at a Given Position Using insert()
          5. Accessing Elements in a Vector Using Array Semantics
          6. Accessing Elements in a Vector Using Pointer Semantics
          7. Removing Elements from a Vector
        3. Understanding the Concepts of Size and Capacity
        4. The STL deque Class
        5. Summary
        6. Q&A
        7. Workshop
          1. Quiz
          2. Exercises
      4. Lesson 18. STL list and forward_list
        1. The Characteristics of a std::list
        2. Basic list Operations
          1. Instantiating a std::list Object
          2. Inserting Elements at the Front or Back of the List
          3. Inserting at the Middle of the List
          4. Erasing Elements from the List
        3. Reversing and Sorting Elements in a List
          1. Reversing Elements Using list::reverse()
          2. Sorting Elements
          3. Sorting and Removing Elements from a list That Contains Instances of a class
          4. std::forward_list Introduced in C++11
        4. Summary
        5. Q&A
        6. Workshop
          1. Quiz
          2. Exercises
      5. Lesson 19. STL Set Classes
        1. An Introduction to STL Set Classes
        2. Basic STL set and multiset Operations
          1. Instantiating a std::set Object
          2. Inserting Elements in a set or multiset
          3. Finding Elements in an STL set or multiset
          4. Erasing Elements in an STL set or multiset
        3. Pros and Cons of Using STL set and multiset
          1. STL Hash Set Implementation std::unordered_set and std::unordered_multiset
        4. Summary
        5. Q&A
        6. Workshop
          1. Quiz
          2. Exercises
      6. Lesson 20. STL Map Classes
        1. An Introduction to STL Map Classes
        2. Basic std::map and std::multimap Operations
          1. Instantiating a std::map or std::multimap
          2. Inserting Elements in an STL map or multimap
          3. Finding Elements in an STL map
          4. Finding Elements in an STL multimap
          5. Erasing Elements from an STL map or multimap
        3. Supplying a Custom Sort Predicate
        4. STL’s Hash Table-Based Key-Value Container
          1. How Hash Tables Work
          2. Using unordered_map and unordered_multimap
        5. Summary
        6. Q&A
        7. Workshop
          1. Quiz
          2. Exercises
    14. Part IV: More STL
      1. Lesson 21. Understanding Function Objects
        1. The Concept of Function Objects and Predicates
        2. Typical Applications of Function Objects
          1. Unary Functions
          2. Unary Predicate
          3. Binary Functions
          4. Binary Predicate
        3. Summary
        4. Q&A
        5. Workshop
          1. Quiz
          2. Exercises
      2. Lesson 22. Lambda Expressions
        1. What Is a Lambda Expression?
        2. How to Define a Lambda Expression
        3. Lambda Expression for a Unary Function
        4. Lambda Expression for a Unary Predicate
        5. Lambda Expression with State via Capture Lists [...]
        6. The Generic Syntax of Lambda Expressions
        7. Lambda Expression for a Binary Function
        8. Lambda Expression for a Binary Predicate
        9. Summary
        10. Q&A
        11. Workshop
          1. Quiz
          2. Exercises
      3. Lesson 23. STL Algorithms
        1. What Are STL Algorithms?
        2. Classification of STL Algorithms
          1. Non-Mutating Algorithms
          2. Mutating Algorithms
        3. Usage of STL Algorithms
          1. Finding Elements Given a Value or a Condition
          2. Counting Elements Given a Value or a Condition
          3. Searching for an Element or a Range in a Collection
          4. Initializing Elements in a Container to a Specific Value
          5. Using std::generate() to Initialize Elements to a Value Generated at Runtime
          6. Processing Elements in a Range Using for_each()
          7. Performing Transformations on a Range Using std::transform()
          8. Copy and Remove Operations
          9. Replacing Values and Replacing Element Given a Condition
          10. Sorting and Searching in a Sorted Collection and Erasing Duplicates
          11. Partitioning a Range
          12. Inserting Elements in a Sorted Collection
        4. Summary
        5. Q&A
        6. Workshop
          1. Quiz
          2. Exercises
      4. Lesson 24. Adaptive Containers: Stack and Queue
        1. The Behavioral Characteristics of Stacks and Queues
          1. Stacks
          2. Queues
        2. Using the STL stack Class
          1. Instantiating the Stack
          2. Stack Member Functions
          3. Insertion and Removal at Top Using push() and pop()
        3. Using the STL queue Class
          1. Instantiating the Queue
          2. Member Functions of a queue
          3. Insertion at End and Removal at the Beginning of queue via push() and pop()
        4. Using the STL Priority Queue
          1. Instantiating the priority_queue Class
          2. Member Functions of priority_queue
          3. Insertion at the End and Removal at the Beginning of priority_queue via push() and pop()
        5. Summary
        6. Q&A
        7. Workshop
          1. Quiz
          2. Exercises
      5. Lesson 25. Working with Bit Flags Using STL
        1. The bitset Class
          1. Instantiating the std::bitset
        2. Using std::bitset and Its Members
          1. Useful Operators Featured in std::bitset
          2. std::bitset Member Methods
        3. The vector<bool>
          1. Instantiating vector<bool>
          2. vector<bool> Functions and Operators
        4. Summary
        5. Q&A
        6. Workshop
          1. Quiz
          2. Exercises
    15. Part V: Advanced C++ Concepts
      1. Lesson 26. Understanding Smart Pointers
        1. What Are Smart Pointers?
          1. The Problem with Using Conventional (Raw) Pointers
          2. How Do Smart Pointers Help?
        2. How Are Smart Pointers Implemented?
        3. Types of Smart Pointers
          1. Deep Copy
          2. Copy on Write Mechanism
          3. Reference-Counted Smart Pointers
          4. Reference-Linked Smart Pointers
          5. Destructive Copy
          6. Using the std::unique_ptr
        4. Popular Smart Pointer Libraries
        5. Summary
        6. Q&A
        7. Workshop
          1. Quiz
          2. Exercises
      2. Lesson 27. Using Streams for Input and Output
        1. Concept of Streams
        2. Important C++ Stream Classes and Objects
        3. Using std::cout for Writing Formatted Data to Console
          1. Changing Display Number Formats Using std::cout
          2. Aligning Text and Setting Field Width Using std::cout
        4. Using std::cin for Input
          1. Using std::cin for Input into a Plain Old Data Type
          2. Using std::cin::get for Input into char* Buffer
          3. Using std::cin for Input into a std::string
        5. Using std::fstream for File Handling
          1. Opening and Closing a File Using open() and close()
          2. Creating and Writing a Text File Using open() and operator<<
          3. Reading a Text File Using open() and operator>>
          4. Writing to and Reading from a Binary File
        6. Using std::stringstream for String Conversions
        7. Summary
        8. Q&A
        9. Workshop
          1. Quiz
          2. Exercises
      3. Lesson 28. Exception Handling
        1. What Is an Exception?
        2. What Causes Exceptions?
        3. Implementing Exception Safety via try and catch
          1. Using catch(...) to Handle All Exceptions
          2. Catching Exception of a Type
        4. Throwing Exception of a Type Using throw
        5. How Exception Handling Works
        6. Class std::exception
        7. Your Custom Exception Class Derived from std::exception
        8. Summary
        9. Q&A
        10. Workshop
          1. Quiz
          2. Exercises
      4. Lesson 29. Going Forward
        1. What’s Different in Today’s Processors?
        2. How to Better Use Multiple Cores
          1. What Is a Thread?
          2. Why Program Multithreaded Applications?
          3. How Can Threads Transact Data?
          4. Using Mutexes and Semaphores to Synchronize Threads
          5. Problems Caused by Multithreading
        3. Writing Great C++ Code
        4. C++17: Expected Features
          1. if and switch Support Initializers
          2. Copy Elision Guarantee
          3. std::string_view Avoids Allocation Overheads
          4. std::variant As a Typesafe Alternative to a union
          5. Conditional Code Compilation Using if constexpr
          6. Improved Lambda Expressions
          7. Automatic Type Deduction for Constructors
          8. template<auto>
        5. Learning C++ Doesn’t Stop Here!
          1. Online Documentation
          2. Communities for Guidance and Help
        6. Summary
        7. Q&A
        8. Workshop
          1. Quiz
    16. Part VI: Appendixes
      1. Appendix A. Working with Numbers: Binary and Hexadecimal
        1. Decimal Numeral System
        2. Binary Numeral System
          1. Why Do Computers Use Binary?
          2. What Are Bits and Bytes?
          3. How Many Bytes Make a Kilobyte?
        3. Hexadecimal Numeral System
          1. Why Do We Need Hexadecimal?
        4. Converting to a Different Base
          1. The Generic Conversion Process
          2. Converting Decimal to Binary
          3. Converting Decimal to Hexadecimal
      2. Appendix B. C++ Keywords
      3. Appendix C. Operator Precedence
      4. Appendix D. ASCII Codes
        1. ASCII Table of Printable Characters
      5. Appendix E. Answers
        1. Answers for Lesson 1
          1. Quiz
          2. Exercises
        2. Answers for Lesson 2
          1. Quiz
          2. Exercises
        3. Answers for Lesson 3
          1. Quiz
          2. Exercises
        4. Answers for Lesson 4
          1. Quiz
          2. Exercises
        5. Answers for Lesson 5
          1. Quiz
          2. Exercises
        6. Answers for Lesson 6
          1. Quiz
          2. Exercises
        7. Answers for Lesson 7
          1. Quiz
          2. Exercises
        8. Answers for Lesson 8
          1. Quiz
          2. Exercises
        9. Answers for Lesson 9
          1. Quiz
          2. Exercises
        10. Answers for Lesson 10
          1. Quiz
          2. Exercises
        11. Answers for Lesson 11
          1. Quiz
          2. Exercises
        12. Answers for Lesson 12
          1. Quiz
          2. Exercises
        13. Answers for Lesson 13
          1. Quiz
          2. Exercises
        14. Answers for Lesson 14
          1. Quiz
          2. Exercises
        15. Answers for Lesson 15
          1. Quiz
        16. Answers for Lesson 16
          1. Quiz
          2. Exercises
        17. Answers for Lesson 17
          1. Quiz
          2. Exercises
        18. Answers for Lesson 18
          1. Quiz
          2. Exercises
        19. Answers for Lesson 19
          1. Quiz
          2. Exercises
        20. Answers for Lesson 20
          1. Quiz
          2. Exercises
        21. Answers for Lesson 21
          1. Quiz
          2. Exercises
        22. Answers for Lesson 22
          1. Quiz
          2. Exercises
        23. Answers for Lesson 23
          1. Quiz
          2. Exercises
        24. Answers for Lesson 24
          1. Quiz
          2. Exercises
        25. Answers for Lesson 25
          1. Quiz
          2. Exercises
        26. Answers for Lesson 26
          1. Quiz
          2. Exercises
        27. Answers for Lesson 27
          1. Quiz
          2. Exercises
        28. Answers for Lesson 28
          1. Quiz
          2. Exercises
        29. Answers for Lesson 29
          1. Quiz
    17. Index
    18. Code Snippets