
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Discover how C++ classes serve as blueprints to define your own types and create objects. Learn how to set up your first C++ class.
Learn to model a cylinder as a C++ class with base radius and height, implement a volume function, and manage access with public and private members.
Explore C++ constructors: how the compiler calls special class methods to initialize objects, with default and parameterized constructors, and member initialization affecting object state.
Discover how default constructors work in C++, using equals default to let the compiler generate an empty constructor, and why any user defined constructor disables the default one.
Explore how getters and setters control access to a class's private data, using a cylinder example to read base radius and height and modify them through public methods.
Split a cylinder class across multiple files by moving constants like pi to a separate header and using include guards; learn header and C++ separation and the scope resolution operator.
Explore creating a C++ class with different ides, including code lite, Visual Studio, and Visual Studio Code, with include guards or pragma once, and a cylinder in a console project.
Explore how to manage class objects with pointers, comparing stack and heap allocations, and using the pointer access operator (->) to access members instead of dereferencing.
Explore destructors, special class methods that release memory allocated in constructors, using delete for heap memory, and understand when destructors run for stack and heap objects.
Demonstrate the call order of constructors and destructors for multiple dog objects, showing constructors run in order while destructors run in reverse order as the compiler manages memory.
Master the this pointer in c++, which points to the current object and reveals its memory address, resolving name conflicts and enabling chained setters.
Compare struct and class in the C++20 masterclass, showing public by default in structs and private by default in classes, with dog, cat, and point examples.
Discover that the size of a class object equals the sum of its member variables, such as int and std::string, while boundary alignment may introduce padding.
Explore how C++ classes act as blueprints for objects, covering class syntax, public and private access, constructors, getters and setters, pointers and this pointer, destructors, structs, and object sizing.
Explore class objects and the const keyword, revealing issues when reading and modifying via getters. See how constant member functions solve these problems and enable safe access.
Explore how declaring objects as const prevents modifying member variables through setters and reading via getters, causing compiler errors and highlighting the need for a solution.
Explore how const objects behave as function arguments in C++ by testing pass-by-value, pass-by-reference (non-const and const), and pointer variants, revealing copies, protections, and compiler errors.
Apply const member functions to read from const objects and prevent modification, overload const and non-const versions, and use getters and printinfo in a dog class.
Learn to make getters double as setters by returning references to member variables, enabling reads and in-place updates, and apply const overloading for const and non-const objects.
Explore dangling pointers and references in class objects, learn why returning local references is dangerous, and how null pointer safety helps prevent memory corruption and crashes.
Zoom in on the const keyword with classes, showing how const objects cannot be modified, and how const member functions enable safe calls while the compiler enforces const correctness.
Discover how mutable member variables let a const member function modify state for debugging, using the mutable keyword in C++. Avoid this pattern in real projects for clarity.
Learn how to use structured bindings in C++ to extract struct members with auto and the copy semantics. Explore printing, lambda capture, and why public members are required.
Master const correctness in C++ objects by using const member functions, returning references in getters, and applying structured bindings and lambda captures from C++20.
Explore how constructors control object building and initialization in C++, using them as windows to customize creation. Learn how default parameters ease object construction in the next lecture.
Explore default parameters for constructors in the cylinder class, using base radius and height defaults, and see how the compiler chooses constructors and handles ambiguity.
Discover how initializer lists in constructors initialize member variables like base radius and height, avoid unnecessary copies, and improve efficiency, with a Cylinder example and syntax explanation.
Compare initializer lists with memberwise copy initialization in C++20 by showing two-step versus one-step object construction, highlighting how initializer lists avoid unnecessary copies and enforce member order.
Learn how explicit constructors prevent implicit conversions by examining a square class, its surface calculation, and how the initializer list, default parameters, and the explicit keyword control conversions.
Learn constructor delegation in c++20 by delegating a one parameter constructor to a three parameter constructor using an initializer list, reducing code duplication in a square class.
Explore how copy constructors work, why shallow copies of pointers fail, and how to implement deep copies with const-reference parameters and dedicated memory allocation.
See how objects stored in a C++ array are copied, invoking copy constructors for each element. Use references in range-based for loops to avoid these copies.
Distinguish shallow copy from deep copy and explore how copy constructors perform member-wise copying versus allocating new memory for pointer members.
Learn how move constructors steal data from temporaries to initialize new objects, using pointer members and std::move to avoid costly copies, illustrated with a Point class example.
Discover how to delete constructors in C++ to prevent their use. Use the equals delete syntax to disable default, copy, and move constructors, causing compiler errors when invoked.
Explore initializer list constructors for aggregates in C++, using structs and std::initializer_list to initialize points, customize behavior, and enforce element counts with runtime checks.
Learn how aggregate initialization in C++ provides a unified way to initialize structs and arrays, using initializer lists and compiler support, demonstrated in Visual Studio Code.
Explore designated initializers in C++20 for selective aggregate initialization, enforce order of member initialization, and observe zero initialization for omitted elements, with compiler errors for out-of-order designators.
Explore uniform initialization for aggregates in C++20, comparing curly braces and parentheses, and showing how narrowing conversions differ for structs and arrays with practical examples.
explore constructors and initialization in C++20, covering default parameters, initializer lists, explicit and move constructors, copy semantics (deep vs shallow), and aggregate and designated initializers.
Explore how to grant external entities access to a class's member variables using friend functions, treating external entities as friends and enabling interaction with classes or functions.
Explore how C++ friend functions grant access to private members of a class, using friend declarations and prototypes; understand they are not class members and how to manage access safely.
Learn how the C++20 Masterclass shows how a friend class enables a separate class to access another's private members, illustrated with a dog and cat example, highlighting non reciprocal access.
Explore how friend functions and external classes access and modify private member variables via the dot operator, and why you should avoid granting friendship lightly.
Welcome to the C++ 23 Masterclass! A course designed to teach you cutting edge modern C++ from the absolute beginning all the way to very advanced topics, the topics you need in areas where C++ is used massively in modern times. Want to be a confident game developer? High performance applications in the financial sector, how about powerful software modules on top of which server systems, network infrastructure, database systems, even operating systems themselves run on top of? Well C++ is the dominant language used in these areas and many more! C++ is the programming language even other programming languages and technologies like NodeJS, PHP, Java, JavaScript and many more are written in.
By learning modern C++, you will be setting yourself up for success in writing software that runs devices ranging from bare metal embedded devices, to mainstream electronic tech products like fridges, toasters, to networking infrastructure like routers and switches, all the way to power plants, manufacturing facilities and medical equipment. C++ is simply everywhere!
This course was carefully designed in a way that it will make you ready to take on technologies and industries where C++ is widely used, by teaching you Modern C++ the way it is used in industry, and you will learn and master how to use shiny new features from the latest C++ standard (C++20) like ranges, modules coroutines, concepts, the three way comparison infrastructure and many more features spread out through out chapters and lectures in the course.
This course will teach you modern C++ from the absolute beginning all the way to a point where you can use advanced features like function templates, class templates, polymorphism, move semantics, functors , callbacks, STL container, iterators and algorithms, I will even show you how to build iterators for your own collection types, giving you the tools to plug into the infrastructure provided by the C++ standard library to tune it to your own needs. Here are some of the things you'll get to master through this course :
C++23
C++20
C++17
C++14
C++11
C++98
Ranges
Modules
Concepts
Coroutines
Classes
Variables and data types
Functions
Inheritance
Polymorphism
Const correctness
Static variables
Storage duration
Linkage
One Definition rule
Operator Overloading
Three way comparison infrastructure
Function like entities
Move semantics
STL containers, iterators and algorithms
And much more!
By the time you're done with the course, you will be ready to use modern C++ with standards C++ 11,C++14, C++17, C++20 and C++ 23, but you will also have the tools necessary to read, understand and work with older C++ code bases with C++98 and below out there, making your C++ skills valuable across a wide range of areas regardless of the C++ standard in use.
The course was designed with complete beginners in mind. So if you have never programmed a computer before, don't worry, I will be with you every step of the way, showing you around, teaching you the tools, constructs and mechanisms necessary to build real C++ projects.
Existing C++ developers or experienced developers from other programming languages will also get a lot of value from the course as we cover advanced topics not covered in other online courses and books as far as I can tell. These include things like building your own iterators, callback functions and many more.
Now C++ is a very powerful language used by big companies like Microsoft, Apple, Google, NASA, and many more across a wide range of products and I can talk about it all day. I am privileged to have been using it in my daily work for the last decade and I am excited to share my accumulated knowledge with you in this course.
If you are serious about learning and mastering cutting edge modern C++, then this course is designed with the skill, the patience and the depth needed to get there as efficiently as possible. Please check some of the preview lectures, and lets get you started with modern C++ development, using C++ 23 as our base standard.