Skip to content
Learn at your own pace

Learn C++

Write modern C++ with RAII, smart pointers, the standard library, templates and safe concurrency, then ship tested, production-quality code.

A student connects colorful building blocks beside a laptop, illustrating a sequence of programming instructions.
One small step becomes a working program.
24lessons in 6 stages
48practice exercises
24project milestones
96quiz questions
96review cards

A clear place to start

C++ supports efficient applications with typed values, reusable objects, and automatic lifetime-based resource management. Standard containers handle many everyday storage tasks.

What you need first

Know variables, loops, and functions in one programming language. You do not have to finish C first. Use a compiler supporting the standard selected by the course examples.

Start with these ideas

  1. Use std::string for owned text and std::vector for a growing sequence rather than beginning with manual allocation.
  2. An object has a lifetime. RAII connects that lifetime to resources such as files and locks, releasing them when their owner ends.
  3. A reference borrows an object. A smart pointer expresses ownership; neither removes the need to understand lifetimes.

Connect it to a real project

Build a reading-list tool with standard containers, then add resource ownership, tests, concurrent work, and a reproducible build.

Study one concept at a time. Explain its everyday example in your own words, predict the worked example’s result, then try a small change. Use practice and quiz feedback to decide what to revisit. You can spread a lesson across several study sessions.

Set up your environment Tools, setup steps, and completion requirements

Start with the ideas above, then set up the tools below. Return to the starter example whenever a new term feels unfamiliar.

text
c++ --version
c++ -std=c++20 -Wall -Wextra -Werror -pedantic -g -o lesson lesson.cpp
./lesson
# Debug builds: add -fsanitize=address,undefined to catch memory errors early.
# Multi-file projects: cmake -S . -B build && cmake --build build && ctest --test-dir build

A free account saves your progress, notes, exercise evidence and spaced review cards. To complete a lesson, score at least 80% on its quiz, finish both exercises and the project checklist, and submit your project link with a reflection. Project evidence is self-reported; use the final portfolio rubrics to seek an independent code review.

Your C++ learning path

Work through these foundations in order, then bring them together in a project.

24 of 24 lessons · follow the stages in order

Start with a small example

Save this as lesson.cpp, compile it with c++ -std=c++20 -Wall -Wextra -o lesson lesson.cpp and run ./lesson. The range-based loop visits each topic by const reference without copying it.

#include <iostream>
#include <string>
#include <vector>

int main()
{
    std::vector<std::string> topics{"RAII", "templates", "ranges"};

    for (const auto& topic : topics) {
        std::cout << "Learn " << topic << '\n';
    }
}

Try it yourself

Sort the topics with std::ranges::sort, then print only those longer than five characters using a std::views::filter view.

Put it into practice

Build a log summarizer

Turn a service log into a summary of levels and errors.

  1. Read a log file line by line with std::getline and handle open failures.
  2. Parse each level into an enum class and count malformed lines.
  3. Store the counts in a std::map and print them in order.
  4. Add unit tests and run them under AddressSanitizer and UndefinedBehaviorSanitizer.
Keep exploring

Find your next course

Choose a language, build on it with a framework, or explore AI and search.

Showing 6 of 17 courses