Free interactive course · 11 lessons

Modern C++
from first line to smart pointers

Stop reading about C++ and start running it. Every lesson has real programs you can edit, compile and step through line by line — with animated memory diagrams that show what the machine is actually doing.

  • No install, no sign-up
  • Real g++ output
  • 11 animated labs

C++20 · progress saved in your browser

hello.cpp C++20

          
g++ 15 · ready
11Lessons
4Parts
40Runnable programs
100%Free access
How it works

Read a little. Run a lot.

C++ is learned by watching what the machine does with your code. Each lesson alternates short explanations with programs you can execute and animations you control.

Short, visual theory

One idea at a time, with diagrams instead of walls of text. Syntax lives inside runnable examples.

Run real C++

Edit any example and press Run. A real g++ compiles it in the cloud and streams back the actual output and errors.

Step through execution

Play, pause and scrub animated traces: the active line, changing variables, call frames and pointer arrows.

Check and practise

Every lesson ends with explained quiz answers and a practice task with a hint and a worked solution.

See it run

Two programs from the end of the course

Both compile and run in this page. Change the names or the numbers, press Run, and watch C++ respond.

10

Algorithms instead of loops

Lesson 10 · templates, iterators and the STL

11

Ownership that cleans itself up

Lesson 11 · unique_ptr and RAII

Syllabus

Eleven lessons, one continuous path

Four parts, each answering a question the previous part leaves open. Start at lesson 1 — every lesson assumes only the ones before it.

Your progress 0 / 11
Start the course
What you get

Mental models, not memorised syntax

When you finish lesson 11 you will not just know C++ features. You will know what happens in memory when you use them — and when not to.

Read memory diagrams

Stack and heap, addresses, references, pointer arithmetic, object layout. You will reason about a program's memory instead of guessing.

Design value types

Constructors, destructors, copy, move and RAII. You will know when the compiler writes them and when you must.

Use the STL with intent

Pick the right container, chain algorithms with lambdas, and understand what an iterator really points to.

Own resources safely

Interfaces with virtual functions, polymorphic containers, and smart pointers that express ownership in the type system.

“C++ gives you the ability to express exactly what you mean — including who owns every byte. That is the whole course in one sentence.”

Modern C++ · lesson 11
FAQ

Before you write line one

The practical details.

Do I need to install a compiler?
No. Each code window sends your program to an online g++ compiler and shows the real output. You can also paste the code into any local compiler later — the examples are standard C++20 with no third-party libraries.
I have never programmed before. Can I start here?
Yes. Lesson 1 assumes nothing: it explains what source code, a compiler and an executable are, then builds up variables, decisions and loops. The only maths you need is arithmetic. If you already program in Python or JavaScript, the pace will feel brisk but comfortable.
Which version of C++ is taught?
Modern C++20: auto, range-based loops, std::vector, move semantics, lambdas, concepts, ranges, smart pointers. Programs compile with GCC 13–15 using -std=c++20. Where a feature is C++23, it is marked as such.
Is my code or progress saved?
Your edits stay in the page; nothing is stored on a server. Completion marks and quiz results live in this browser's localStorage, so they survive a reload but not a different device. Code you press Run on is sent to Wandbox or Compiler Explorer solely to be compiled and executed.
How long does the course take?
About 10–12 hours in total: 45–70 minutes per lesson, including the programs, lab, quiz and practice task. You can do one lesson per sitting, or read two shorter ones together.
Does this replace cppreference?
No — it prepares you to use it. Every lesson links to the exact cppreference pages worth reading next, so you learn the language and the reference simultaneously.
Free interactive course

Your first program
takes four lines.

Then eleven lessons take you all the way to smart pointers, virtual dispatch and the STL. One idea, one program, one animation at a time.

Free · No sign-up · Real compiler output