Free tutorial · 21 lessons
C++ Tutorial
Learn modern C++ (C++20) step by step: types, strings, control flow, functions, references, pointers, smart pointers, RAII, classes, inheritance, templates, the STL, ranges, exceptions, move semantics and threads — with outputs shown.
C++ Basics
- C++ Introduction — What C++ is, where it's used and a first program.
- C++ Get Started — Install a compiler, compile and run a program, and use CMake.
- C++ Syntax and Output — Statements, namespaces, comments, cout and std::format.
- C++ Variables and Data Types — Fundamental types, auto, const, constexpr and initialisation.
- C++ Strings — std::string operations, string_view and conversions.
- C++ Operators and Math — Arithmetic, comparison, logical operators and <cmath>.
- C++ History & Versions — How Bjarne Stroustrup turned "C with Classes" into C++, every ISO standard from C++98 to C++26 on one timeline, why C++11 is called "modern C++", and which standard to use today.
Control Flow and Functions
- C++ Conditions and Loops — if, switch, for, range-based for, while and do-while.
- C++ Functions — Declare functions, pass by value or reference, defaults, overloading and lambdas.
Memory and Pointers
- C++ References and Pointers — Addresses, pointers, references, nullptr and when to use each.
- C++ Smart Pointers and RAII — unique_ptr, shared_ptr, RAII and why you rarely write new/delete.
Object-Oriented C++
- C++ Classes and Objects — Classes, access specifiers, constructors, member functions and const.
- C++ Inheritance and Polymorphism — Base classes, virtual functions, override and abstract classes.
- C++ Templates — Function and class templates, and C++20 concepts.
Standard Library
- C++ Vector — std::vector: the default container — add, access, iterate and erase.
- C++ Maps and Sets — std::map, std::unordered_map, std::set and structured bindings.
- C++ Algorithms and Ranges — sort, find, accumulate, transform and C++20 ranges.
Advanced C++
- C++ Exceptions — throw, try, catch, standard exception types and noexcept.
- C++ Move Semantics — Copy vs move, std::move and the rule of zero.
- C++ Threads — std::thread, std::jthread, mutexes and std::async.
Next Steps
- C++ Next Steps — Build systems, tools, books and interview practice.