The _______ smart pointer in C++ does not allow the pointer to be shared among objects. 

  • unique_ptr 
  • weak_ptr 
  • shared_ptr 
  • custom_ptr
unique_ptr is a smart pointer that owns a dynamically allocated object exclusively. It ensures that only one unique_ptr can point to the object at a time. If another unique_ptr tries to take ownership, the original will relinquish its hold, ensuring uniqueness.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *