What you’ll learn
- Chapter 1Understanding the first program – First the form, then your own values.
Hallo, C++! · New line and comments · int: remembering whole numbers · string: storing text - Chapter 2Calculating and choosing paths – Data types, comparisons and conditions.
double, bool and const · Calculating with numbers · Understanding comparisons · if and else - Chapter 3Repeating and forming building blocks – Loops, lists and your own functions.
for: repeat on purpose · vector: a list of numbers · A function with input · Everything together: your points coach - Chapter 4Workshop: understand and build it yourself – Practise new building blocks with short explanations and your own programs.
Visiting all values of a vector · A function with two inputs · Input with cin - Chapter 5New tools for your own ideas – Understand new concepts, fill them in and use them yourself.
struct: describing a course · const reference: only reading a list · sort: ordering numbers sensibly - Chapter 6Level up: your next practice chapter – Understand four new building blocks in small steps and use them yourself.
enum class: naming states · std::array: a fixed number · Overloading: same name, different parameters · find: searching for a value in a list - Chapter 7Master chapter: how real programs are built – Five building blocks from real projects – explained, connected, filled in and written by you.
std::map: storing values under names · class: protecting data, offering behaviour · Lambda: a condition as a small function · unique_ptr: memory that cleans up after itself · try and catch: catching errors - Chapter 8Project tools: understand and apply – Eight more building blocks with explanation pages and four exercises per lesson.
std::array for fixed sizes · std::optional for a missing result · std::find: iterator instead of index · std::accumulate with an initial value · enum class prevents loose number comparisons · Reading large values as a const reference · Naming several map values together · One function for several number types - Chapter 9Strings and streams – Split, convert and sort texts, and analyse CSV lines.
string: size, substr and find · Converting: stoi and to_string · Reading texts with stringstream · Sorting texts · Boss: analysing a CSV line - Chapter 10STL algorithms – Counting, converting, finding extreme values and removing values – with <algorithm>.
count_if: counting with a condition · transform: converting every value · min_element and max_element · Removing values: erase and remove_if · Boss: learning statistics - Chapter 11Classes in depth – Initialiser lists, const methods, virtual, operators and polymorphism.
The initialiser list · const methods: read only · virtual and override · Overloading operators · Boss: shapes with polymorphism - Chapter 12map, set and pair – Ordered dictionaries with map, unique sets with set, unpacking pairs and counting words.
A sorted dictionary: std::map · Every value only once: std::set · Unpacking pairs: structured bindings · Counting words with unordered_map · Boss: a grade book - Chapter 13Safe memory: RAII and smart pointers – Constructor and destructor, unique_ptr, transferring ownership with move, shared_ptr and a scene full of shapes.
Automatic clean-up: destructor and RAII · One owner: std::unique_ptr · Passing ownership on: std::move · Shared ownership: std::shared_ptr · Boss: a scene full of shapes - Chapter 14Templates and lambdas – Functions and classes for many types, small functions right in the code and algorithms with rules of your own.
One function for many types: template · Classes for many types · Functions right in the code: lambdas · Lambdas in algorithms · Boss: a data pipeline
Final project: C++ points coach
A complete program with a score, a calculation and feedback.
How it works
Every lesson starts with short explanation pages. Then you practise with multiple-choice questions, fill-in-the-gap tasks, putting code in order and writing your own code – with hints and instant feedback. Free, without ads, on phone, tablet and PC.