C++ how to create shared pointer for a string
Answers
Answered by
4
Answer:
Since there can be one unique_ptr for single resource its not possible to copy one unique_ptr to another. shared_ptr. A shared_ptr is a container for raw pointers. It is a reference counting ownership model i.e. it maintains the reference count of its contained pointer in cooperation with all copies of the shared_ptr.
Similar questions