CppPath learning path

C++ Course Outline: 111 Lessons from Beginner to Advanced

Choose a starting point based on your experience. Each lesson teaches one topic, checks understanding with a quiz, and ends with a challenge that CppPath checks by compiling your C++17 program.

Availability: The first two lessons are open to everyone. Signed-in Free learners can start up to five new lessons per UTC day; the limit resets at 00:00 UTC. Free learners can review lessons they have started, and Pro includes unlimited new lessons. Signed-out visitors can read the public introductions and open the two Free lessons and projects; protected lessons and Pro projects show previews until sign-in or upgrade. The remaining projects require Pro.

Where to start: If you are new to programming, begin with Beginner: Program Structure. If you know basic syntax, review the chapter titles and choose the track that matches your experience.

Beginner

Start here if you are new to C++. This track builds core syntax, control flow, functions, data, and reliable program structure.

Getting Started

  1. Program Structure

    Understand what a minimal C++ program looks like and what each line actually does.

  2. Variables & Types

    Learn how C++ stores integers, decimals, characters, booleans and text.

  3. Input & Output

    Read data from the user and display results.

  4. Conditions

    Make your programs choose what to do using if, else if and else.

Free guide: Your first C++ program

Control Flow & Functions

  1. Loops

    Repeat work efficiently with for and while loops.

  2. Functions & Arrays

    Organize reusable logic and store groups of values.

  3. Operators & Expressions

    Learn how arithmetic, comparison, logical and assignment operators combine into expressions.

  4. Variable Scope

    Understand where variables exist and where they can be accessed.

Data & Containers

  1. std::string Basics

    Work confidently with text using the C++ standard string type.

  2. std::vector Basics

    Use a resizable sequence instead of fixed-size arrays when the amount of data can change.

  3. Read-Only Values & auto

    Use const to protect values and auto to keep obvious or verbose types readable.

Free guide: C++ string exercises

More Control Flow

  1. switch Statements

    Handle several exact-value branches cleanly with switch.

  2. do-while Loops

    Learn the loop that always runs its body at least once.

  3. break & continue

    Control loop execution more precisely.

  4. Validating Input with while

    Use a while loop to recover from malformed input, reject values outside a range, and stop safely at end of input.

Free guide: Jump to case label

Functions & Custom Types

  1. Function Parameters & Return Values

    Separate inputs, processing and outputs in reusable functions.

  2. Function Overloading

    Give multiple functions the same name when their parameter lists differ.

  3. Enums

    Represent a small fixed set of named choices.

  4. Structs

    Group related pieces of data into your own simple type.

  5. Collections of Records

    Combine structs and vectors to store and inspect a growing set of related records.

Project Structure & Debugging

  1. Header & Source Files

    Split a growing program across .h/.hpp and .cpp files.

  2. Compiling & Linking

    Follow source code through preprocessing, compilation, and linking.

  3. Command-Line Arguments

    Read values supplied when someone starts a program from a terminal.

  4. Compiler Errors & Warnings

    Learn to read compiler messages instead of guessing what went wrong.

  5. Testing & Debugging Small Programs

    Separate build failures from behavior bugs, then check a small program with known cases.

  6. Beginner Project: Number Analyzer

    Combine input, loops, functions and vectors into a small complete program.

Free guide: No such file or directory

Writing Reliable Code

  1. Comments & Readability

    Write code that another programmer can understand quickly.

  2. Numeric Types & Limits

    Choose numeric types deliberately and understand that every type has a range.

  3. Integer Overflow & Safe Arithmetic

    Check integer bounds before arithmetic that could exceed a type's range.

  4. Type Conversions & Casting

    Learn when C++ converts values automatically and when an explicit cast is clearer.

  5. Common Mathematical Functions

    Use the standard math library for roots, powers, magnitudes, and rounding.

  6. Compound Assignment & Increment

    Write common updates concisely with +=, -=, *=, /=, ++ and --.

Everyday Data & Logic

  1. std::string Operations

    Go beyond storing text: measure, search, slice, and modify strings.

  2. Character Classification and Conversion

    Classify individual characters and change their case with the cctype library.

  3. std::vector Operations

    Learn the everyday operations used to grow, inspect, and remove vector elements.

  4. Search, Count, and Find Minimum or Maximum

    Use one-pass loops to search values, count matches, and track an extreme value.

  5. Nested Loops

    Use one loop inside another for grids, tables, and pairwise work.

  6. Multidimensional Arrays

    Represent simple fixed-size grids with more than one array dimension.

  7. Random Numbers

    Generate pseudo-random values with the modern <random> library.

Free guide: C++ string exercises

Beginner Capstone

  1. Beginner Project: Guessing Game

    Combine variables, loops, conditions, and random numbers into a complete mini-game.

Intermediate

Continue here after the fundamentals. This track develops classes, the standard library, errors, files, ownership, and object lifetime.

References, Pointers & Classes

  1. References

    Work with an existing object without copying it.

  2. Pointers

    Understand addresses, dereferencing and nullptr.

  3. Classes & Objects

    Bundle state and behavior into your own types.

Polymorphism & STL Basics

  1. Inheritance & Polymorphism

    Create related types and use virtual dispatch.

  2. STL Containers

    Use vector, map, set and other battle-tested standard containers.

  3. Algorithms & Iterators

    Sort, search and transform data using the standard library.

  4. Sorting & Searching with Comparators

    Order records by multiple fields and search them with predicates.

  5. Transforming and Removing Elements

    Use standard algorithms to derive values, count matches, and remove selected vector elements safely.

Class Design

  1. Constructors & Destructors

    Control what happens when objects are created and destroyed.

  2. Access Control & static Members

    Use public/private boundaries and data shared by every object of a class.

  3. const Correctness

    Express which values and member functions are not allowed to modify state.

  4. Operator Overloading

    Define natural operators for your own types when the meaning is clear.

Errors, Files & Namespaces

  1. Exceptions

    Handle exceptional failures using throw, try and catch.

  2. Choosing an Error-Handling Strategy

    Choose a failure-reporting approach based on how expected a failure is and who needs to handle it.

  3. File I/O

    Read from and write to files with standard stream classes.

  4. Parsing Lines with String Streams

    Parse complete lines and build formatted text with string streams.

  5. Namespaces

    Organize names and avoid collisions in larger programs.

Iterators, Lookup & Callables

  1. Iterator Patterns

    Understand iterators beyond basic begin/end usage.

  2. Maps, Sets & Lookup

    Choose containers based on whether you need key/value storage or unique values.

  3. std::function & Callables

    Store functions, lambdas and other callable objects behind one interface.

Ownership & Design

  1. Composition

    Build larger classes by owning smaller objects instead of inheriting everything.

  2. Dynamic Memory: new & delete

    Understand manual allocation so you can recognize why modern ownership tools are safer.

  3. Copy Semantics

    Understand when objects are copied and why some classes need custom copy behavior.

  4. Testing Stateful Components

    Use focused tests to verify class operations, rejected changes, and the invariants that protect object state.

  5. Intermediate Project: Inventory System

    Combine classes, containers, file I/O and algorithms in one practical exercise.

Container Toolkit

  1. std::array, deque & list

    Choose among several standard sequence containers instead of always reaching for vector.

  2. Iterator Categories and Algorithm Requirements

    Match an algorithm to the operations its iterator category supports, and choose the right way to move through a range.

  3. std::unordered_map

    Use hash-based key/value lookup when sorted ordering is not required.

Object Design & Lifetime

  1. Constructors in Depth

    Use initializer lists, delegating constructors, and explicit constructors to build valid objects.

  2. Abstract Classes & Interfaces

    Define common behavior that derived classes are required to implement.

  3. Virtual Destructors

    Destroy derived objects correctly through base-class pointers.

  4. Object Lifetime & Ownership

    Reason about when objects exist, who owns resources, and when references become invalid.

Non-Owning Views

  1. std::string_view

    Pass read-only text without copying or owning it.

  2. std::span

    Pass contiguous sequences without copying and without hard-coding the container type.

Systems Utilities

  1. std::filesystem

    Work with paths, files, and directories using the standard library.

  2. Traversing Directories with std::filesystem

    Create a small directory, inspect its entries safely, and produce stable output from a filesystem traversal.

  3. std::chrono & Timing

    Represent durations and measure elapsed time using type-safe clocks.

Advanced

Use this track after intermediate C++. It covers templates, modern library tools, memory, performance, and concurrency.

Templates & Resource Ownership

  1. Templates

    Write generic code that works with multiple types.

  2. RAII

    Tie resource lifetime to object lifetime.

  3. Smart Pointers

    Manage dynamic ownership without manual delete in most cases.

  4. Move Semantics

    Transfer expensive resources instead of copying them.

Lambdas & Threads

  1. Lambdas

    Create small callable functions exactly where you need them.

  2. Concurrency Basics

    Start understanding threads, mutexes and synchronization.

Generic Programming

  1. Template Specialization

    Customize generic behavior for a particular type when the general template is not enough.

  2. Perfect Forwarding

    Preserve whether arguments are lvalues or rvalues through generic wrapper code.

  3. constexpr & Compile-Time Evaluation

    Move eligible computations into compile time.

  4. Concepts

    Constrain templates with readable requirements in C++20.

  5. Dependent Names and Two-Phase Lookup

    Understand how templates defer checks for names that depend on their type arguments.

Modern Library Types

  1. Ranges

    Use modern composable views and algorithms for data processing.

  2. std::optional & std::variant

    Represent missing values and type-safe alternatives without magic sentinel values.

  3. std::expected & Explicit Errors

    Represent either a result or an error value in modern C++.

Type Tools & Special Members

  1. Type Traits

    Inspect and transform types at compile time.

  2. Type Erasure and Runtime Interfaces

    Choose between compile-time templates, closed variants, and runtime type-erased interfaces.

  3. Rule of Zero / Five

    Design ownership-aware classes with correct copy and move behavior.

Concurrency

  1. Atomics

    Perform certain shared-memory operations without a data race.

  2. Mutexes & condition_variable

    Coordinate threads that share state or need to wait for work.

  3. Futures & std::async

    Receive a result from asynchronous work.

  4. Memory Model & Ordering

    Understand the rules that make multithreaded memory accesses meaningful.

  5. Advanced Project: Thread-Safe Work Queue

    Combine RAII, templates, condition variables and ownership into a realistic component.

Advanced Generic Patterns

  1. Variadic Templates

    Write templates that accept a variable number of typed arguments.

  2. Fold Expressions

    Reduce a parameter pack with a compact operator expression.

  3. Custom Iterators

    Make your own types work naturally with range-based loops and algorithms.

  4. CRTP

    Use the Curiously Recurring Template Pattern for compile-time polymorphism.

Modern Language Tools

  1. Coroutines

    Pause and resume functions with C++20 coroutine machinery.

  2. Three-Way Comparison (<=>)

    Generate consistent ordering comparisons with the C++20 spaceship operator.

Memory & Allocation

  1. Polymorphic Memory Resources

    Control allocation strategy without changing a container's element interface.

Advanced Concurrency

  1. Latches & Barriers

    Coordinate groups of threads using C++20 synchronization primitives.

Performance & Architecture

  1. Profiling & Performance

    Measure before optimizing and reason about algorithmic cost, allocations, and data access.

  2. Undefined Behavior and Sanitizer Workflows

    Recognize common undefined behavior and use sanitizers to expose defects during testing.

  3. Cache Locality and Data Layout

    Arrange data around the access pattern so processors can use nearby memory efficiently.

  4. Advanced Project: Type-Safe Event Bus

    Combine variants, visitors, templates, and structured event types into a reusable event system.

C++ projects

Apply course concepts in guided programs. Project descriptions on this page use the public project summaries.

  1. Console CalculatorFree

    Build a calculator that performs several operations and handles invalid choices cleanly.

  2. Number Guessing GameFree

    Turn the beginner guessing-game idea into a complete replayable console game.

  3. Mini Text AdventurePro

    Create a small branching adventure with locations, choices, health, and a win/lose condition.

  4. Weather Station LogPro

    Record whole-degree readings from weather stations, reject invalid entries, and search and summarize accepted readings.

  5. Text Statistics ToolPro

    Summarize pasted text with counts, a longest word, and the most frequent letter.

  6. Inventory ManagerPro

    Build a reusable inventory system that can add, remove, search, and update item quantities.

  7. Text Log AnalyzerPro

    Read a line-oriented log, count records by level, and report malformed lines.

  8. Banking SystemPro

    Model bank accounts with encapsulated state, validation, and transfers between objects.

  9. Character Save SystemPro

    Serialize a character to disk and load the data back into a valid object.

  10. Floor Plan EstimatorPro

    Parse room dimensions, compare room areas, and estimate flooring material and cost.

  11. Type-Safe Event SystemPro

    Build an event dispatcher that routes strongly typed events to registered callbacks.

  12. Thread-Safe Job QueuePro

    Build a queue that safely transfers jobs between producer and worker threads.

  13. LRU Response CachePro

    Build a fixed-capacity cache that keeps recent weather API responses ready for a dashboard.

  14. Expression CalculatorPro

    Parse spreadsheet-style expressions with variables, precedence, and explicit error results.

  15. Telemetry Ring BufferPro

    Keep the latest sensor samples in fixed storage and summarize them through standard algorithms.

Free guides

Use these public guides to practice related topics and troubleshoot common compiler messages.