Courses / Specialisations & media / C++ Programming

Free courseSelf-paced

C++ Programming

Build a modern C++ command-line application with RAII, CMake, GoogleTest tests and clean sanitizer runs.

  • Who it's for. Learners who know C (functions, arrays, pointers, structs) and want to write safe modern C++.
  • Before you start. Prerequisite course the earlier course (C Programming) or equivalent: the learner can write, compile and run a C program with functions, arrays, pointers and structs, and has read a compiler error.
  • 36 to 60 hours of study with practice
  • 13 modules, 63 lessons
  • 3 guided projects and a final project

What you'll learn

  • Build, run and debug multi-file modern C++ programs with a free compiler (GCC, Clang or MSVC) under a strict warning set
  • Explain lvalues, rvalues and std::move, and implement move operations for a resource-owning class
  • Use std::vector, map-like containers, iterators, lambdas and standard algorithms instead of hand-written loops
  • Run threads safely with join or jthread, mutexes and atomics, and explain a data race as undefined behaviour
  • Test a library with GoogleTest through CMake and ctest, and ship a tested, file-persistent command-line application

Skills you'll gain

  • Toolchain
  • language basics
  • Functions
  • value types
  • References
  • lifetime
  • Classes
  • RAII
  • Move semantics
  • error handling
  • Standard containers
  • Algorithms
  • iterators
  • Templates

Tools you'll use

  • C++
  • CMake
  • ctest
  • GoogleTest
  • AddressSanitizer
  • UndefinedBehaviorSanitizer
  • Standard library containers and algorithms

Details to know

  • Certificate on completionIssued after your final project is reviewed
  • 13 module checkpointsA quiz and a practical task close each module
  • Self-pacedStudy any time; your progress is saved

How every lesson works

Each lesson follows the same four steps, so you always know what comes next.

  1. 01

    Watch & Learn

    A short animated video explains one idea at a time.

  2. 02

    Guided Practice

    Work through an example step by step and check the result.

  3. 03

    Quiz & Challenge

    Short questions check the idea has landed before you move on.

  4. 04

    Mini Project

    Build something useful from a project brief.

Learn at your own pace

This is a self-paced course. There are no live classes and no fixed timetable.

  • Start any timeStudy when it suits you. Lessons are short, so they fit around work or college.
  • Pick up where you left offYour progress is saved to your account.
  • Ask when you're stuckUse Ask Mentor inside the learning platform.

Your path in 4 phases

Each phase ends with something you have built and checked.

  1. 01

    Modules 1 to 4

    Resource-safe record reader

    Covers Toolchain and language basics, Functions and value types, References and lifetime and Classes and RAII.

    You build: Resource-safe record reader: Value-type record struct and parser functions with typed returns.

  2. 02

    Modules 5 to 8

    Generic data pipeline

    Covers Move semantics and error handling, Standard containers, Algorithms and iterators and Templates and errors. Write and constrain function and class templates and diagnose their compile and link errors.

    You build: Generic data pipeline: Container-backed store with iterator-safe updates; A templated summary function constrained by a concept.

  3. 03

    Modules 9 to 12

    Tested and sanitized service core

    Covers Ownership and smart pointers, Concurrency basics, Undefined behaviour and sanitizers and Files and tests. Persist data through files and prove loaders and libraries with GoogleTest, CMake and ctest.

    You build: Tested and sanitized service core: Ownership map with unique_ptr factory; GoogleTest suite wired through CMake and ctest, with the sanitizer build configuration.

  4. 04

    Module 13

    Modern C++ application with RAII resource safety and tests

    Plan, build, persist, test and sanitize a complete modern C++ application and present it for review.

    You build: The final project, demonstrated to a trainer.

Full curriculum

13 modules and 63 lessons, 36 to 60 hours of study

01Toolchain and language basics5 lessons, 2 to 4 hours

Lessons

  • From hello.cpp to a running program: compile, link, run
  • Fundamental types and brace initialization
  • Reading and printing with iostream and getline
  • Branching and range-for loops over a vector
  • Compiler warnings as a safety net

After this module you can

  • Run the compile and link steps on a one-file program and tell a compile error from a link error by its message class.
  • Declare values of int, double, bool and char with brace initialization and predict which conversions the compiler rejects.
  • Enable a strict warning set, read one warning and fix the cause instead of silencing it.
02Functions and value types5 lessons, 2 to 4 hours

Lessons

  • Pass by value, by const reference, and what a copy costs
  • Returning values: structured bindings and return value semantics
  • Overloading and default arguments
  • const and constexpr: values fixed at run time and at compile time
  • std::string as a value type

After this module you can

  • Choose between value and const reference for a function parameter and predict whether a copy is made.
  • Return multiple results from a function with std::pair or a small struct and unpack them with structured bindings.
  • Build, concatenate, compare and search std::string values and explain why copies are independent.
03References and lifetime5 lessons, 2 to 4 hours

Lessons

  • Lvalue references as aliases
  • Dangling references and returning references to locals
  • Pointers as optional, non-owning observers
  • std::string_view: a non-owning window and its lifetime trap
  • Object lifetime, scope and temporaries

After this module you can

  • Declare a T& alias, explain that it must bind at initialization and cannot be reseated, and predict the effect of writing through it.
  • Spot a function that returns a reference to a local variable and replace it with a returned value.
  • State when an automatic object, a temporary and a static object are destroyed and predict constructor and destructor print order.
04Classes and RAII6 lessons, 3 to 4 hours

Lessons

  • Class invariants, private data and member initializer lists
  • Destructors and scope-bound release: RAII
  • Copy construction, copy assignment and the double free
  • Rule of three, five and zero
  • const member functions and operator overloading for value types
  • Virtual functions and polymorphic base destructors

After this module you can

  • Design a class whose constructor establishes an invariant and whose private data cannot break it from outside.
  • Write a class whose constructor acquires a resource and whose destructor releases it on every exit path.
  • Call an overridden function through a base reference and explain why a polymorphic base needs a virtual destructor.
05Move semantics and error handling6 lessons, 3 to 5 hours

Lessons

  • Value categories and std::move as a cast
  • Writing move constructor and move assignment for a buffer owner
  • Moved-from objects: valid but unspecified
  • Exceptions: throw, catch by reference and stack unwinding
  • noexcept and why destructors must not throw
  • std::optional and std::expected for expected failures

After this module you can

  • Classify expressions as lvalue, prvalue or xvalue and state that std::move only casts to an rvalue reference.
  • Implement noexcept move operations that steal a pointer and leave the source empty.
  • Return std::optional for absence and std::expected for absence-with-reason, and choose between them and exceptions for a given case.
06Standard containers5 lessons, 2 to 4 hours

Lessons

  • std::vector: size, capacity and checked access
  • Iterator and reference invalidation in vector
  • std::map and std::unordered_map: ordering and missing keys
  • std::set and std::array: uniqueness and fixed size
  • Storing objects: push_back, emplace_back and moving into a container

After this module you can

  • Distinguish size from capacity and choose between operator[] and at() for a given access.
  • Predict which iterators and references survive push_back, insert and erase on a vector.
  • Fill a container without extra copies by constructing in place or moving, and verify with a tracer.
07Algorithms and iterators5 lessons, 2 to 4 hours

Lessons

  • Iterator ranges and iterator categories
  • Sorting with std::sort, comparators and strict weak ordering
  • Lambdas and capture
  • Searching and transforming: find_if, count_if, transform, accumulate
  • C++20 ranges: views and ranges::sort

After this module you can

  • Describe a half-open range [first, last) and say which algorithms need which iterator capability.
  • Sort a vector of records with a comparator and explain why <= is not a valid comparator.
  • Compose a lazy filter and transform pipeline over a range and say when its work runs.
08Templates and errors5 lessons, 2 to 4 hours

Lessons

  • Function templates and type deduction
  • Class templates: a generic Stack<T>
  • C++20 concepts: constraining a template
  • Reading template error messages
  • Header-only templates and linking

After this module you can

  • Write a function template, predict the deduced type for each call and recognise a deduction conflict.
  • Implement a small class template, instantiate it for two element types, and place its definition in a header.
  • Explain why a template definition belongs in a header and diagnose a link error caused by a missing instantiation.
09Ownership and smart pointers4 lessons, 2 to 3 hours

Lessons

  • std::unique_ptr: single ownership that moves
  • release, reset, get and custom deleters
  • std::shared_ptr and weak_ptr: shared ownership and cycles
  • Choosing ownership: values first, unique_ptr second, shared_ptr last

After this module you can

  • Create a unique_ptr with make_unique, transfer it with std::move and explain why it cannot be copied.
  • Choose between get, release and reset and attach a custom deleter to a resource that is not freed with delete.
  • Pick an ownership model for a given design and justify it in one sentence per object.
10Concurrency basics4 lessons, 2 to 3 hours

Lessons

  • Starting a std::thread and joining it
  • Data races and protecting shared data with a mutex
  • scoped_lock, std::atomic and avoiding deadlock
  • std::jthread, cooperative stop and returning results with futures

After this module you can

  • Run a function on a std::thread, join it before the object is destroyed and predict the outcome of forgetting.
  • Identify a data race and remove it by guarding the shared variable with std::mutex and lock_guard.
  • Use std::jthread so destruction joins, request a stop, and obtain a result with std::async and a future.
11Undefined behaviour and sanitizers4 lessons, 2 to 3 hours

Lessons

  • What undefined behaviour is and why compilers exploit it
  • AddressSanitizer: out-of-bounds and use-after-free
  • UndefinedBehaviorSanitizer: runtime checks for integer and pointer UB
  • A sanitizer-driven debugging routine

After this module you can

  • Define undefined behaviour, list four common sources and explain why 'it worked on my machine' proves nothing.
  • Build with -fsanitize=address, run a defect-seeded program and read the report class and the source line.
  • Reduce a failing program to a minimal case, fix its cause and add a regression test that fails before the fix.
12Files and tests5 lessons, 2 to 4 hours

Lessons

  • Reading and writing text files with fstream
  • Parsing records and validating input without crashes
  • GoogleTest: TEST, EXPECT and ASSERT
  • CMake targets, GoogleTest and ctest
  • Testing failure paths: exceptions, temporary files and sanitizers

After this module you can

  • Read lines from a file and write results to another, checking that each open succeeded and relying on the destructor to close.
  • Parse comma-separated records and turn every malformed line into a reported error instead of undefined behaviour.
  • Test the error branches of a file loader, including an exception, on temporary files that are cleaned up.
13Application project4 lessons, 2 to 3 hours

Lessons

  • Designing the application: modules, ownership map and test plan
  • Building the core library with tests first
  • Adding persistence and error handling
  • Sanitizer-clean release and reproducible demonstration

After this module you can

  • Produce a one-page design naming modules, the owner of every object, the error strategy and the first ten tests before writing code.
  • Implement the domain types and logic in a library target, driven by failing tests that go green one at a time.
  • Run the complete test suite under both sanitizers, produce setup instructions that a reviewer can follow, and demonstrate the program live.

What you'll build

3 guided projects along the way, then a final project.

  • Resource-safe record reader

    after module 4
  • Generic data pipeline

    after module 8
  • Tested and sanitized service core

    after module 12

Final project

Modern C++ application with RAII resource safety and tests: a command-line ledger or record tool with a class hierarchy kept to values, a library plus executable built by CMake, GoogleTest tests run by ctest, file persistence that survives restart, and AddressSanitizer plus UndefinedBehaviorSanitizer runs recorded clean..

What you submit

Source and CMake project submitted as an archive or repository link Functional checks: a supplied input file produces a supplied expected output Error handling: missing file, malformed record and invalid argument each give a defined message and exit status.

How it's reviewed

Trainer review against a weighted rubric: C o r r e c t n e s s o n s u p p l i e d a n d h i d d e n i n p u t s 2 5 p e r c e n t ; R A I I a n d o w n e r s h i p c l a r i t y ( n o l e a k s , n o r a w o w n i n g p o i n t e r s ) 2 0 p e r c e n t ; t e.

Where you'll use it

  • Replace manual new and delete with owning types so every resource has a named owner.
  • Run a test suite under sanitizers to prove a memory bug is fixed.

Roles that use these skills

  • C++ developer
  • Systems programmer
  • Embedded software engineer

Earn the certificate by building, not watching

  1. Complete the lessons and pass each module checkpoint.
  2. Build your final project and demonstrate it.
  3. OUTLEARN reviews your project and issues your certificate. It is not issued automatically.

Frequently asked questions

What should I know before starting?

The course expects C Programming or an accepted equivalent. Prerequisite course the earlier course. A short diagnostic check is described in the entry requirements.

What do I build for the final project?

You choose one of 3 options: Command-line ledger; Text-document indexer; Grid simulation. It is reviewed by a trainer in a live demonstration.

When do I get a certificate?

Only after you build and demonstrate your live project. OUTLEARN staff issue certificates; nothing is issued automatically.

Be first in when C++ Programming opens

Email us and we will tell you as soon as enrolment opens.

Notify me when it opens
FreeOpens soon
Notify me