C++
From your first program to pointers, memory, classes, templates and the STL. Every example is compiled and run on a real server, with self-checking exercises and a final project.
Every chapter is an island. Finish its lessons, beat its challenge, and sail on ⛵
Island 1
C++ fundamentals
- Your first C++ programWhat a compiled language is, the parts of a program, and cout.8 min2 🎮
- Variables and typesint, double, char, bool, string, auto and const, and why types matter.9 min3 🎮
- Operators and input%, ++, compound operators, cin, and operator precedence.8 min3 🎮
- Conditions: if and switchif/else, logical operators, switch and the ternary operator.9 min2 🎮
- Loopsfor, while and do-while, break and continue, and nested loops.10 min3 🎮
Island 2
Functions and collections
- FunctionsDefining and returning, default arguments, and overloading.9 min2 🎮
- References: by value or by reference?Does a function get a copy or the original, and why const& is everywhere.9 min2 🎮
- Strings and arraysstd::string and its methods, fixed arrays, and std::array.9 min2 🎮
- std::vectorAn array that grows itself: push_back, size versus capacity, and how it's stored.10 min2 🎮
- map, set and unordered_mapLook things up by key, count occurrences, and drop duplicates.10 min2 🎮
Island 3
Memory and pointers
- PointersAddresses, * and &, nullptr, and pointers with arrays.11 min3 🎮
- Stack, heap, new and deleteMemory that frees itself, and memory you're responsible for.10 min3 🎮
- Smart pointers and RAIIunique_ptr and shared_ptr, and the idea that makes C++ safe.11 min2 🎮
Island 4
Classes and OOP
- struct and classData and functions in one type, public and private, and const methods.10 min3 🎮
- Constructors and destructorsInitializer lists, when destructors run, and the rules of zero and three.11 min2 🎮
- Inheritance and virtual functionsOne class building on another, polymorphism, and why destructors must be virtual.12 min2 🎮
- TemplatesWrite a function or class once and use it with any type.10 min2 🎮
Island 5
The STL and professional C++
- Algorithms and lambdassort, find_if, count_if and accumulate, with one-line functions.11 min3 🎮
- Exceptionsthrow, try and catch, the standard error types, and how RAII fits in.9 min2 🎮
- RecursionA function calling itself: the base case, the call stack, and memoization.10 min2 🎮
- Project: a grade bookClasses, vectors, maps, algorithms and exceptions in one program.15 min3 🎮