A _______ is a smart pointer that owns and manages another object through a pointer and disposes of that object when the _______ goes out of scope. 

  • auto_ptr 
  • unique_ptr 
  • shared_ptr 
  • raw_ptr
A unique_ptr in C++ is a type of smart pointer that owns a dynamically allocated object exclusively. It ensures that the owned object is properly deallocated once the unique_ptr that owns it goes out of scope, preventing memory leaks.
Add your answer
Loading...

Leave a comment

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