Pointers and References in C++: Using Smart Pointers in Modern C++

placeholder

Dynamic memory allocation and deallocation in C are performed using malloc() and free(). In classic C++ dynamic memory allocation and deallocation are performed using new and delete and array new and array delete. In modern C++ it’s smart pointers that take over. Begin this course by examining the idea behind smart pointers. You will then explore the different types of smart pointers including unique pointers shared pointers and weak pointers. Discover why weak pointers are required in some cases to avoid circular references that can cause memory leaks. After completing this course youll be able to use smart pointer objects leverage RAII to use shared unique and weak pointers and avoid circular references using weak pointers.