Beginner¶
Start here if you've never written C++, or never finished a course. By the end you'll be compiling real programs from multiple source files, and you'll have built a command-line app that persists data to disk.
Lessons¶
| # | Lesson | You'll learn |
|---|---|---|
| 1 | Setup & your first program | compiling vs running, main, std::cout, std::cin, compiler flags |
| 2 | Variables & data types | int double char bool std::string, auto, const, brace init |
| 3 | Numbers & math | integer division, %, overflow, casts, <cmath>, <random> |
| 4 | Strings | std::string, std::format, find/substr, std::string_view |
| 5 | Booleans & conditionals | comparisons, &&/\|\|/!, if/else, switch, ternary |
| 6 | Loops | for, range-for, while, do/while, break/continue |
| 7 | Arrays & vectors | std::vector, std::array, sorting, copying vs referencing |
| 8 | Maps & sets | std::map, std::unordered_map, std::set, structured bindings |
| 9 | Functions | pass by value / reference / const&, overloading, defaults, recursion |
| 10 | Headers, namespaces & multi-file programs | .hpp/.cpp, declarations vs definitions, linking, namespaces |
| 11 | Files & error handling | <fstream>, std::filesystem, exceptions, std::optional |
| 12 | Capstone: task tracker | put it all together in a real CLI app |
How to work through it¶
- One lesson per sitting. Type every example. Compile with
-Wall -Wextra. Do the exercises. - Don't move on until the "Recap" all makes sense.
- Stuck? Re-read the "Common mistakes" section — your bug is probably there.
When you're done¶
You should be able to explain every line of the capstone and add a new feature to it unaided. Then go to Intermediate.