The C++ Course¶
A complete, self-paced modern C++ curriculum in Markdown. Work through it top to bottom, or jump to the level that matches your experience.
How this course is organized¶
| Folder | For you if... | Outcome |
|---|---|---|
| Beginner | You have never written C++ (or never finished a course) | Write and compile real programs, understand the core language, build a CLI app |
| Intermediate | You know the syntax but pointers, classes and memory still feel shaky | Pointers, RAII, smart pointers, classes, templates, the STL, CMake, testing, a real project |
| Advanced | You ship C++ and want depth | Move semantics, concepts, constexpr, concurrency, coroutines, performance, UB, ABI |
Each lesson is one file and follows the same shape:
- What & why – the idea in plain language
- Examples – compilable code you should type out yourself
- Common mistakes – the traps everyone hits
- Exercises – do these; reading is not learning
- Recap
Setup (do this first)¶
You need a compiler that supports C++20: GCC 13+, Clang 17+, or MSVC 2022 (17.8+).
- macOS:
xcode-select --installgives you Apple Clang;brew install gcc llvm cmakefor newer versions - Windows: install Visual Studio 2022 Community with the "Desktop development with C++" workload, or use MSYS2 for GCC
- Linux:
sudo apt install build-essential cmake gdb(or your distro's equivalent)
A good editor helps a lot: VS Code with the C/C++ or clangd extension, CLion, or Visual Studio.
Compile every example in this course with warnings turned on:
How to study¶
- Type every example. Copy-paste teaches you nothing.
- Read the compiler errors. Start at the first error; the rest are often fallout.
- Break things on purpose. Change a line, predict the result, compile, run.
- Do the exercises before looking anything up.
- One lesson per sitting is plenty. Consistency beats marathons.
Curriculum at a glance¶
Beginner¶
- Setup & your first program
- Variables & data types
- Numbers & math
- Strings
- Booleans & conditionals
- Loops
- Arrays & vectors
- Maps & sets
- Functions
- Headers, namespaces & multi-file programs
- Files & error handling
- Capstone: command-line task tracker
Intermediate¶
- Pointers & references
- Memory: the stack, the heap & RAII
- Smart pointers
- Classes: fundamentals
- Copy, move & the rule of five
- Operator overloading
- Inheritance & polymorphism
- Templates
- STL algorithms & lambdas
- Build systems: CMake
- Testing with Catch2
- Capstone: Markdown link checker
Advanced¶
- Move semantics & perfect forwarding
- Variadic & advanced templates
- Concepts
- constexpr & compile-time programming
- Concurrency: threads, mutexes & atomics
- Async, futures & coroutines
- Performance & profiling
- Undefined behavior & sanitizers
- Design patterns, the C++ way
- Ranges & views
- Libraries, ABI & packaging
- Capstone: parallel file indexer
License¶
Use freely for learning and teaching.