C++ has been one of the most popular programming languages for over 30 years. Developers use it for everything from building video games to coding operating systems.

We just published a comprehensive 31-hour C++ course on the freeCodeCamp.org YouTube channel.

Daniel Gakwaya developed this course. Daniel is an experienced software engineer and course creator.

This course will give you a comprehensive introduction to modern C++ with C++20. You will go from being a beginner to an advanced user.

Here are all the topics covered in this course:

Chapter 1: Setting up the tools

  • Tools
  • Installing C++ Compilers on Windows
  • Installing VS Code on Windows
  • Configuring Visual Studio Code for C++ on Windows
  • Installing C++ Compilers on Linux
  • Installing Visual Studio Code on Linux
  • Configuring Visual Studio Code for C++ on Linux
  • Installing C++ Compilers on MacOs
  • Installing Visual Studio Code on MacOs
  • Configuring Visual Studio Code for C++ on MacOs
  • Online Compilers

Chapter 2: Diving in

  • Your First C++ Program
  • Comments
  • Errors and Warnings
  • Statements and Functions
  • Data input and output
  • C++ Program Execution Model
  • C++ core language Vs Standard library Vs STL

Chapter 3: Variables and data types

  • Variables and data types Introduction
  • Number Systems
  • Integer types : Decimals and Integers
  • Integer Modifiers
  • Fractional Numbers
  • Booleans
  • Characters And Text
  • Auto
  • Assignments
  • Variables and data types summary

Chapter 4: Operations on Data

  • Introduction on Data operations
  • Basic Operations
  • Precedence and Associativity
  • Prefix/Postfix Increment & Decrement
  • Compound Assignment Operators
  • Relational Operators
  • Logical Operators
  • Output formatting
  • Numeric Limits
  • Math Functions
  • Weird Integral Types
  • Data Operations Summary

Chapter 5: Flow Control

  • Flow Control Introduction
  • If Statements
  • Else If
  • Switch
  • Ternary Operators
  • Flow Control Summary

Chapter 6: Loops

  • Loops Introduction
  • For Loop
  • While Loop
  • Do While Loop

Chapter 7: Arrays

  • Introduction to Arrays
  • Declaring and using arrays
  • Size of an array
  • Arrays of characters
  • Array Bounds

Chapter 8: Pointers

  • Introduction to Pointers
  • Declaring and using pointers
  • Pointer to char
  • Program Memory Map Revisited
  • Dynamic Memory Allocation
  • Dangling Pointers
  • When new Fails
  • Null Pointer Safety
  • Memory Leaks
  • Dynamically allocated arrays

Chapter 9: References

  • Introduction to References
  • Declaring and using references
  • Comparing pointers and references
  • References and const

Chapter 10: Character Manipulation and Strings

  • Introduction to Strings
  • Character Manipulation
  • C-string manipulation
  • C-String concatenation and copy
  • Introducing std::string
  • Declaring and using std::string

Chapter 11: Functions

  • The One Definition Rule
  • First Hand on C++ Functions
  • Function Declaration and Function Definitions
  • Multiple Files - Compilation Model Revisited
  • Pass by value
  • Pass by pointer
  • Pass by reference

Chapter 12: Getting Things out of functions

  • Introduction to getting things out of functions
  • Input and output parameters
  • Returning from functions by value

Chapter 13: Function Overloading

  • Function Overloading Introduction
  • Overloading with different parameters

Chapter 14: Lambda functions

  • Introduction to Lambda Functions
  • Declaring and using lambda functions
  • Capture lists
  • Capture all in context
  • Summary

Chapter 15: Function Templates

  • Introduction to function templates
  • Trying out function templates
  • Template type deduction and explicit arguments
  • Template parameters by reference
  • Template specialization

Chapter 16: C++20 Concepts Crash course

  • Introduction to C++20 Concepts
  • Using C++20 Concepts
  • Building your own C++20 Concepts
  • Zooming in on the requires clause
  • Combining C++20 Concepts
  • C++20 Concepts and auto

Chapter 17: Classes

  • Introduction to classes
  • Your First Class
  • C++ Constructors
  • Defaulted constructors
  • Setters and Getters
  • Class Across Multiple Files
  • Arrow pointer call notation
  • Destructors
  • Order of Constructor Destructor Calls
  • The this Pointer
  • struct
  • Size of objects

Chapter 18: Inheritance

  • Introduction to Inheritance
  • First try on Inheritance
  • Protected members
  • Base class access specifiers : Zooming in
  • Base class access specifiers - A demo
  • Closing in on Private Inheritance
  • Resurrecting Members Back in Context
  • Default Constructors with Inheritance
  • Custom Constructors With Inheritance
  • Copy Constructors with Inheritance
  • Inheriting Base Constructors
  • Inheritance and Destructors
  • Reused Symbols in Inheritance

Chapter 19: Polymorphism

  • Introduction to Polymorphism
  • Static Binding with Inheritance
  • Dynamic binding with virtual functions
  • Size of polymorphic objects and slicing
  • Polymorphic objects stored in collections (array)
  • Override
  • Overloading, overriding and function hiding
  • Inheritance and Polymorphism at different levels
  • Inheritance and polymorphism with static members
  • Final
  • Virtual functions with default arguments
  • Virtual Destructors
  • Dynamic casts
  • Polymorphic Functions and Destructors
  • Pure virtual functions and abstract classes
  • Abstract Classes as Interfaces

Watch the full course below or on the freeCodeCamp.org YouTube channel (31-hour watch).