C++ Course · 65 lessons · approx. 413 minutes

Learn C++

Learn C++ in an understandable way: every new character is explained and then practised in small tasks. Prepared coding tasks check solution patterns. No C++ compiler is built in.

  • main & cout
  • Variables
  • Data types
  • Calculating
  • Conditions
  • Loops
  • vector
  • Functions
  • Your own programs & going deeper
  • struct: describing a course
  • const reference: only reading a list
  • sort: ordering numbers sensibly
  • enum class: naming states
  • std::array: a fixed number
  • Overloading: same name, different parameters
  • find: searching for a value in a list
  • 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
  • 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
  • Strings and streams
  • STL algorithms
  • Classes in depth
  • map, set and pair
  • Safe memory: RAII and smart pointers
  • Templates and lambdas

What you’ll learn

  1. 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
  2. Chapter 2Calculating and choosing paths – Data types, comparisons and conditions.
    double, bool and const · Calculating with numbers · Understanding comparisons · if and else
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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.

Learn C++ now