
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.
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.
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
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
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.
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.
Explains the purpose of enumerated types and when to use them.
Implementation of scoped enums.
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.
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
Learn how to create user-defined literals for your own types.
You'll learn how to write expressions that can be evaluated at compile time, thereby increasing the performance of your code.
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.
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.
Explains why exception handling is required and how it is better than returning simple error codes.
This video explains more details on catch blocks.
This video explains the concept of stack unwinding. It also explains the pitfalls of manual memory management with exception handling..
Explains the concept of nested exception handling and demonstrates its usage with an example.
This video explains exception handling in context of constructors and destructors.
Introduces the noexcept keyword. We learn its purpose and where it should be used.
Learn C++ in depth with modern features introduced with C++11/14/17
Updated with C++17 features!
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 a filesystem library (covered in the course), parallel versions of STL algorithms, new library types such as std::optional, std::any and more.
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 [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