
This video gives an introduction of your instructor. It also gives an overview of the course content and the target audience.
Source code of examples
A note on different C++ compilers
This lecture shows the installation process of Visual Studio 2015 for C++ programming. Prefer installing Visual Studio 2019 instead.
In this video, you 'll learn how to install Visual Studio 2017 and also how to create a C++ project. I also explain a few differences between VS2015 & VS 2017 in the project creation dialogs.
This video explains how to install VIsual Studio 2019 & the steps for creating a C++ project.
[UPDATE] A new version of Code::Blocks was recently released. The MingW compiler bundled now supports all C++11/14 features, however, some C++17 features may be missing. If you don't care about C++17 now, just download the entire package with compiler. Otherwise, follow the instructions in the video & install the compiler separately.
In this video,I'll explain how to install Code::Blocks and configure it with a separate build of MingW on Windows.
Note: Cevelop is no longer in production. Use VSCode or Eclipse CDT instead.
In this video, I'll explain how to install Cevelop. Cevelop is an enhanced version of Eclipse CDT and focuses on modern C++ development.
I'll also demonstrate how to create a project in Cevelop and how to add new classes to existing project.
Note: To run Cevelop, you'll have to install Java runtime & a GNU-based C++ compiler. You can download Java from www.java.com and MinGW from mingw.org.
In this lecture, I'll show you how to download, install and use XCode on MacOS for creating C++ programs
Introduces Modern C++ and where it is used. It explains why C++ is chosen over other languages.
This video explains the structure of the first C++ program. It also gives an overview of compilation in Visual Studio.
Explains the C++ build process in detail.
Introduces primitive types in C++.
Gives overview of basic input/output classes and demonstrates how to write on the console & read from the keyboard.
This lecture explains the basics of functions in C++.
I'll discuss the concept of function declaration & definition. And we'll see some more examples of functions.
Gives a gentle introduction to debugging C++ applications in Visual Studio and also explains a few common shortcuts.
Learn about different types of initialization in C++ including the new Uniform Initialization syntax and its advantages
Introduces pointers, syntax and their usage.
Tests your understanding of pointers and their syntax.
Explains reference type and how to use it instead of pointers.
Test your understanding of references.
Compares pointers and references and explains how to choose between them
Explains the importance of const qualifier and its usage.
Explains how to use const qualifier with pointers and references.
Test your understanding of using const qualifier with pointers and references
Introduces the auto keyword and explains how to use it to infer types automatically.
Introduces the new range-based for loop in C++11 and explains how to use it.
In this lecture, you'll understand how the range-based for loop works internally.
Learn about the new init-statement in the range-based for loop.
Explains function overloading and how to use it
Another convenience feature for programmers. This video explains syntax and usage
Explains how to increase performance of your code by making your functions inline.
Note: The option of forcing inlining no longer works in newer versions of Visual Studio. To see inlined function disassembly, simply build your project in Release configuration.
Introduces function pointers and explains their purpose.
Explains how to use namespaces to group types together and avoid name clashes
Learn about this convenient feature of namespaces that simplifies the syntax of creating nested namespaces.
Explains basics of dynamic memory allocation in C. This will build up a base for understanding dynamic memory allocation in C++.
Learn how to use the new operator to allocate memory at runtime in C++. You'll also learn why new operator is preferred over malloc in C++.
This lecture explains how to create arrays on heap using new [] operator. You'll also learn how to create strings on heap in C++.
Learn the basics of 2D arrays and how they're created on the heap in C++ using the new[] operator.
Source code only
Gives an overview of Object Oriented programming principles and how they relate to real-life objects.
Explains the meaning and syntax of class
Explains the purpose of constructors and destructor and how they can be used to manage object initialization.
Explains the meaning and purpose of structures in C++
Explains this C++11 feature and shows how to use it to initialize class members directly inside a class.
Explains this pointer and its purpose
Explains how to use the static keyword to create static member variables & functions
Learn how to use inline variables at global and class scope.
Explains how to create read-only functions through the const qualifier
Explains the copy constructor and why it is required
Explains how & when to implement a user-defined copy constructor. Also explains the rule of 3.
Explains the C++11 feature of delegating constructors and how it can be used to prevent code duplication in constructors.
Explains how to use the C++11 keywords, default & delete, to control what functions are synthesized by the compiler.
This lecture starts with the basics of l-values and r-values and then explains C++11 feature, R-value references.
This lecture builds up the base for understand mandatory copy elision. It shows the limitation of copy elision in pre-C++17 standards.
This lecture explains mandatory copy elision introduced in C++17. Even without copy & move constructors, you can initialize objects with rvalues.
Explains the concept of move semantics and how it improves performance.
Shows how to implement move semantics in a class.
Learn about the Rule of 5 & 0. Also understand in which cases the class functions are automatically synthesized by the compiler.
Learn about copy elision and how it eliminates extra copies of temporary objects.
Shows how to use std::move function to force move semantics on l-value
Contains source code only.
Explains the basics of operator overloading and implementation of common unary & binary operators
Explains why assignment operator is important
Shows when operators need to be overloaded as global functions. Also shows implementation of overloaded stream operators (<< and >>).
Explains the purpose of friend keyword and when & where to use it.
Explains the RAII idiom (Resource Acquisition Is Initialization). Shows how to overload -> and * operator to create a smart pointer.
Demonstration of the smart pointers in C++11 (std::unique_ptr & std::shared_ptr)
Go to Section 6 for in-depth explanation of C++11 smart pointers.
A short discussion on the operator overloading rules.
Discussion on conversion between types using C++ casting operators
Explanation & implementation of how constructors are used by the compiler to perform type conversion.
Explains how to implement type conversion operator function to convert a user-defined type into primitive type.
In this video, I explain how to use the type conversion operator to perform conversions between different user defined types.
Explains why initialization should be preferred over assignment. Also explains the concept of member initializer list.
In this lecture, I'll explain why we need smart pointers.
You'll learn about the unique_ptr and its properties in this video.
In this lesson, I'll build an example that will be used to explain why we std::unique_ptr cannot be used in all cases.
I'll try to share the pointer resource using unique_ptr and find out if it works.
Since unique_ptr cannot be used for sharing the underlying resource, I'll replace it with shared_ptr. A shared_ptr allows sharing of the underlying resource and it manages this information through a reference count. Learn how it works in this lecture.
We'll look at a problem with shared_ptr while using a resource that may be destroyed anytime.
Continuing from the previous lecture, you'll learn how weak_ptr can be used to weakly point to a resource without preventing it from getting destroyed. You'll also understand how it achieves this behavior.
In this lecture, we'll learn about circular references and how using shared_ptr may lead to memory leaks. Finally, we'll use weak_ptr to prevent memory leaks.
We can store any kind of resource in a smart pointer, but it needs to be released correctly. This can be done through a deleter. This lesson explains the concept and its usage.
This lesson explains how we can use smart pointers to manage pointers to dynamic arrays.
The construction process of a smart pointer can be simplified with std::make_ functions. You'll learn about these functions in this lesson.
Read about where source code is uploaded in lectures
This lecture explains which features were removed in C++17 standard.
Learn and understand the issues with unspecified expression evaluation order and how C++17 fixes it.
Explains the purpose of enumerated types and when to use them.
Implementation of scoped enums.
Learn how you can perform initialization in if/switch conditions.
Demonstrates raw string and their usage. You get to learn why raw strings should be avoided.
Introduces std::string class from the standard library and its usage.
Introduces the C++11 raw string literals and explains their purpose & usage.
Learn how to create user-defined literals for your own types.
Learn & understand the basics of std::string_view class.
In this lecture, you'll understand the different situations where std::string_view should be and should not be used.
Assignment on string conversion.
Explains string streams and their purpose. Also introduces the new string conversion functions of C++11.
Coding assignment on std::string
You'll learn how to write expressions that can be evaluated at compile time, thereby increasing the performance of your code.
Understand how compile time if (if constexpr) performs conditional checks at compile time, thereby improving the performance of your code.
This lecture shows the internals of how the conditional statements are discarded with compile time if expressions.
This video discusses the purpose of std::initializer_list in depth.
Introduces the std::vector class and demonstrates common operations of creation, insertion, deletion, etc.
This lecture explains basics of unions and how to use them.
In this lecture, we'll see the caveats of using user-defined types as members in a union.
Learn about the attributes added in C++11, C++14 & C++17 and how they can be used in code.
Source code of Account classes
We revisit inheritance and composition and explain it again with examples. This will give you a better understanding of these concepts.
Explains access modifiers in context of inheritance.
Explains the project on inheritance, that we'll implement in the subsequent videos.
Implementation of the Account hierarchy
Assignment
This video implements the Checking class. Shows how to invoke the base class member functions from the child classes. Also explains the inheriting constructors from C++11 and where to use them.
Introduces the virtual keyword and explains why it is needed.
Explains the underlying implementation of virtual mechanism
This video walks through the code that is generated for virtual functions in Visual Studio. It also explains why base class destructors should be virtual.
This lecture explains the purpose of override & final specifier.
Discussion on upcasting & downcasting within the objects of a class hierarchy. Also learn about object slicing and how to avoid it.
This video explains the concepts of Run-time type Information and also introduces the typeid operator
This video explains the purpose of dynamic_cast operator & how to use it.
Understand the concept of pure virtual functions and the abstract classes and learn when and where to use them.
This video explains the issue that arises with diamond inheritance. You'll learn how to solve it by virtual inheritance and how it is implemented internally.
Learn C++ in depth starting with C++98 all the way to C++23.
C++ is a general purpose programming language invented by Bjarne Stroustrup. It is still one of the more popular programming languages, used for creating high performance applications across a wide variety of domains & platforms.
In 2011, C++11 was born. This revision added lot of new features to the language and it got a new name, Modern C++. This emphasizes writing C++ code using modern features of the language such as move semantics, automatic type inference, threading, lambda expressions, smart pointers and a lot more. C++11 was followed by C++14, that added even more features and enhanced existing ones. C++17 released in 2017 added new core language features such as structured binding, mandatory copy elision, compile-time if, etc., and new library types such as std::optional, std::any and more.
The evolution continued with C++20 and C++23, introducing new ways to write expressive, readable, and maintainable code. C++20 brought significant improvements to the language and standard library, including concepts, ranges, std::span, enhanced constexpr capabilities, and the three-way comparison operator. C++23 builds on this foundation with further language and library improvements, including std::mdspan, flat containers, std::expected for representing values or errors and modern text-output facilities such as std::print and std::println.
This course teaches C++ as an object oriented language with modern features. It focuses on teaching C++ concepts, both old and new, with clear examples. It builds upon the basic language facilities that are then used to build more complex programs with classes, operator overloading, composition, inheritance, polymorphism, templates, concurrency, etc. It even digs deep into assembly to understand few concepts better. After every few topics, a quiz is presented that tests your understanding of the previous topics. Have fun learning Modern C++.
Note that this course is not for you if
You have never programmed before
You don't know ANY programming language
You want to learn basics of programming
Update [October, 2026] : Even bigger update. Added C++20 & C++23 core language & library features.
Update [April 19, 2020] : Biggest update so far. Added C++17 core language changes, template enhancement and new library types.
Update [April 11, 2020] : Added content on copy elision, type traits, static_assert & generalized lambda capture, C++11 unions
Update [Mar 25, 2020]: XCode installation & high-level concurrency (std::async)
Update [Mar 1, 2019] : More videos added for memory management with smart pointers (shared_ptr, unique_ptr, weak_ptr_)
Update [Oct 19, 2017] :Instructions added for installing Visual Studio Community 2017, Cevelop (Eclipse) & Code::Blocks
Update [Sep 29, 2107] : Added more content on dynamic memory allocation (malloc, new[], 2D arrays, strings)
Update [Sep 16, 2017] : C++ concurrency (std::thread, std::mutex, etc)
Update [April 27, 2017] : Templates, Function Object, Lambda Expressions, Standard Template Library
Update [Mar 23, 2017] : Virtual Inheritance, Exception handling, File I/O, std::filesystem (C++17)
Update [Mar 4, 2017] : Strings, stringstreams, enums, inheritance, polymorphism
Update [Feb 25, 2017] : Source Code of existing topics added