Pointer

Smart Pointer

gap-in-knowledge

Link: https://www.geeksforgeeks.org/smart-pointers-cpp/

Types of Smart Pointers:

C++ libraries provide implementation of smart pointers in the following types:

  • auto_ptr no idea what that is
  • uniqe_ptr Unique Pointer
  • shared_ptr Shared Pointer
  • weak_ptr no idea what that is either

To use them, make sure to include <memory> library.

shared_ptr vs unique_ptr?

https://stackoverflow.com/questions/6876751/differences-between-unique-ptr-and-shared-ptr