Learn C++ with modern features introduced with C++11/14
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
C++ is a general purpose programming language invented by Bjarne Stroustrup 37 years ago. 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 onces. In 2017, we may see a new release called C++17, that will add a filesystem library (covered in the course), parallel versions of STL algorithms, new types such as std::optional 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. 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
NOTE:The course will be continuously updated with videos on the more topics.
This video gives an introduction of your instructor. It also gives an overview of the course content, prerequisites and the target audience.
A note on different C++ compilers
Shows how the installation process of Visual Studio for C++ programming
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.
Gives a gentle introduction to debugging C++ applications in Visual Studio and also explains a few common shortcuts.
Explains the new way of initialization of scalar types.
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 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.
This will help you gauge your understanding of the topics learned so far.
Introduces the new range-based for loop in C++11 and explains 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
Introduces function pointers and explains their purpose.
Explains how to use namespaces to group types together and avoid name clashes
Explains how to use new & delete to allocate memory at runtime
This quiz will further test your knowledge of the previous topics.
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 during declaration.
Explains this pointer and its purpose
Explains how to create read-only functions through the const qualifier
Explains how to use the static keyword to create static member variables & functions
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.
This quiz will test your understanding of classes, constructors, destructors and copy semantics
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.
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. Also explains the rule of 5.
Shows how to use std::move function to force move semantics on l-value
This quiz will test your understanding of move semantics and the new keywords (default, delete)
Contains source code only.
Explains the basics of operator overloading and implementation of common unary & binary operators
Explains why assignment operator is important, along with the Rule of 3
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)
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.
Explains why initialization should be preferred over assignment.
This will test your understanding of operator overloading & type conversions.
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
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.
Test your understanding on enums, strings, stringstreams & vector
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
Add the Checking class to the hierarchy and inherit it from the Account class. It does not have any interest rate, therefore, it will not implement the corresponding member functions. The only difference is that the account mandates the balance should not fall below 50. So, you'll have to re-implement the Withdraw function accordingly.
You should proceed only after implementing the entire Account hierarchy.
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 why it is needed.
This part will test your understanding of basic concepts of inheritance.
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
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 quiz will test your understanding of virtual mechanism, virtual inheritance & RTTI.
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.
Test your knowledge & understanding of exception handling.
Introduces the C++11 raw string literals and explains their purpose & usage.
This video gives a glimpse of the features of the filesystem library from the C++17 standard.
Introduction to basic file I/O. Demonstrates reading and writing data into text files.
This lecture shows how to handle errors during file I/O through stream state flags.
Uses file I/O to create a utility that copies text files.
This video explains the following:
In this video, we learn how to perform binary input/output operations on files.
Assignment on file copy utility
Additions to the earlier assignment.
File copy utility source files.
This quiz will test your understanding of file I/O concepts.
Introduces generic programming through templates. You'll also learn the basic syntax of templates and how to write a function template.
Assignment on basic templates
This video explains
Explains what is explicit specialization and why is it required.
Explains the purpose of non-type template arguments. Then, we use this concept to implement efficient algorithms.
Source code only.
Introduces perfect forwarding, which is a very important concept implemented through R-value references.
We understand how perfect forwarding preserves type information of template function arguments.
Gives a gentle introduction to variadic templates. We learn how to write functions that accept arbitrary number of arguments.
We take a deep dive into the internals of how variadic templates work.
Here, I'll introduce you to class templates. You'll also learn how to decipher the complex declaration/definition of class member functions.
Just like functions, classes can also be specialized, with a few differences. This video gives a gentle introduction of this concept.
In this video, we'll see some more examples of explicit specialization of class templates, that will help you understand and implement specialization easily.
Explains the concept of partial specialization of class templates. Also discusses examples of when and where to use it.
We first understand the concept of type definitions & type aliases and then compare them. Then, I explain the concept of type aliases with templates.
Test your knowledge & understanding of templates.
Revisits the concepts of function pointers as callbacks.
Introduces function objects as callbacks and explains why they're better than function pointers.
Gives a gentle introduction of lambda expressions and shows how they replace function objects. Also explains the optional specifiers and auto return type.
Introduces the capture list.
Capture list is explained in depth with default modes.
Test your knowledge of callbacks, function objects & lambda expressions.
Civil engineer who found his calling in software development. Never worked as a Civil engineer, jumped at the first chance and started teaching C++ & Visual C++ 13 years ago. Currently, trains software professionals in various IT companies in India in different technologies, such as C++, Advanced C++, STL, Design Patterns, Android, Unity, Linux, etc. Very passionate about teaching and has trained more than 10,000 software professionals in a teaching career spanning more than 10 years. An avid gamer, currently trying his hand with game development in Unity & Unreal. Has a few Android applications to his credit, including one on Design Patterns.
Only thing he likes more than C++ is Modern C++.