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.
Loading...
Related Quiz
- Which data type would be most appropriate for storing a boolean value?
- Creating user-defined exceptions in C++ can be achieved by inheriting the _______ class.
- In tail recursion, the recursive call is the _______ action to be performed in the function.
- How does the virtual base class resolve the diamond problem in C++?
- Which type of class inheritance allows a derived class to inherit attributes and methods from more than one base class?