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

C++    |    Expert
  • 13 videos | 1h 39m 20s
  • Includes Assessment
  • Earns a Badge
Rating 4.5 of 13 users Rating 4.5 of 13 users (13)
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

  • 2m 12s
  • 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 on some of our courses, which can be shared on any social network or business platform.

Digital badges are yours to keep, forever.

YOU MIGHT ALSO LIKE

Rating 5.0 of 5 users Rating 5.0 of 5 users (5)
Rating 4.3 of 6 users Rating 4.3 of 6 users (6)
Rating 4.4 of 5 users Rating 4.4 of 5 users (5)

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE

Rating 4.5 of 26 users Rating 4.5 of 26 users (26)
Rating 4.5 of 2861 users Rating 4.5 of 2861 users (2861)
Rating 4.0 of 7 users Rating 4.0 of 7 users (7)