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

C++ 20    |    Expert
  • 13 Videos | 1h 39m 20s
  • Includes Assessment
  • Earns a Badge
Likes 1 Likes 1
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 course
    outline the concept of smart pointers
    recall how unique pointers, shared pointers, and strong pointers work
    create unique pointers to automatically deallocate memory
    copy, transfer, and reset pointers
    create shared pointers using various syntaxes
    examine strong and weak counts of shared pointers
  • examine values stored in shared pointers
    introduce weak pointers and contrast them with strong pointers
    recognize the limitations of weak pointers
    recognize how weak pointers can become invalid
    recognize how weak pointers can be deallocated
    summarize the key concepts covered in this course

IN THIS COURSE

  • Playable
    1. 
    Course Overview
    2m 12s
    UP NEXT
  • Playable
    2. 
    Introduction to Smart Pointers
    6m 32s
  • Locked
    3. 
    Types of Smart Pointers
    4m 50s
  • Locked
    4. 
    Introducing Unique Pointers
    9m 14s
  • Locked
    5. 
    Exploring Unique Pointers
    10m 23s
  • Locked
    6. 
    Creating Shared Pointers
    9m 37s
  • Locked
    7. 
    Exploring Shared Pointers
    8m 36s
  • Locked
    8. 
    Exploring Finer Points of Shared Pointers
    10m 25s
  • Locked
    9. 
    Creating Weak Pointers
    9m 59s
  • Locked
    10. 
    Exploring Finer Points of Weak Pointers
    7m
  • Locked
    11. 
    Exploring Invalid Weak Pointers
    9m 29s
  • Locked
    12. 
    Understanding the Use Case of Weak Pointers
    6m 56s
  • Locked
    13. 
    Course Summary
    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 of this course, which can be shared on any social network or business platform

Digital badges are yours to keep, forever.