Pointers and References in C++: Using Smart Pointers in Modern C++
C++
| Expert
- 13 videos | 1h 39m 20s
- Includes Assessment
- Earns a Badge
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, you'll be able to use smart pointer objects, leverage RAII to use shared, unique, and weak pointers, and avoid circular references using weak pointers.
WHAT YOU WILL LEARN
-
Discover the key concepts covered in this courseOutline the concept of smart pointersRecall how unique pointers, shared pointers, and strong pointers workCreate unique pointers to automatically deallocate memoryCopy, transfer, and reset pointersCreate shared pointers using various syntaxesExamine strong and weak counts of shared pointers
-
Examine values stored in shared pointersIntroduce weak pointers and contrast them with strong pointersRecognize the limitations of weak pointersRecognize how weak pointers can become invalidRecognize how weak pointers can be deallocatedSummarize the key concepts covered in this course
IN THIS COURSE
-
2m 12s
-
6m 32s
-
4m 50s
-
9m 14s
-
10m 23s
-
9m 37s
-
8m 36s
-
10m 25s
-
9m 59s
-
7m
-
9m 29s
-
6m 56s
-
4m 7s
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.
Digital badges are yours to keep, forever.