Short, visual theory
One idea at a time, with diagrams instead of walls of text. Syntax lives inside runnable examples.
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.
C++20 · progress saved in your browser
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.
One idea at a time, with diagrams instead of walls of text. Syntax lives inside runnable examples.
Edit any example and press Run. A real g++ compiles it in the cloud and streams back the actual output and errors.
Play, pause and scrub animated traces: the active line, changing variables, call frames and pointer arrows.
Every lesson ends with explained quiz answers and a practice task with a hint and a worked solution.
Both compile and run in this page. Change the names or the numbers, press Run, and watch C++ respond.
Lesson 10 · templates, iterators and the STL
Lesson 11 · unique_ptr and RAII
Four parts, each answering a question the previous part leaves open. Start at lesson 1 — every lesson assumes only the ones before it.
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.
Stack and heap, addresses, references, pointer arithmetic, object layout. You will reason about a program's memory instead of guessing.
Constructors, destructors, copy, move and RAII. You will know when the compiler writes them and when you must.
Pick the right container, chain algorithms with lambdas, and understand what an iterator really points to.
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 11The practical details.
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.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