C++, End to End
C++, End to End
This is a full course, not a syntax reference. It starts at the absolute basics and goes all the way through templates, the standard library, and the parts of modern C++ that show up in real code today. Each page is written to stand on its own, but they build on each other in order, so read top to bottom the first time through.
Every runnable example in this course is a live, editable Compiler Explorer panel embedded right in the page. Change the code, hit run, see what actually happens. That's the whole point: C++ has more sharp edges than most languages, and the fastest way to understand one is to poke it yourself instead of taking a paragraph's word for it.
Use the sidebar to jump around once you've done a first pass. The chapters go roughly: language basics, the type system, functions and templates, classes and objects, containers and the STL, memory and move semantics, inheritance and polymorphism, then a tour of modern C++ and the idioms experienced C++ programmers actually reach for.
If you'd rather compile locally: any recent g++ or clang++ with -std=c++20 will run almost everything here. A handful of later examples reach for C++23 and say so explicitly.