Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

Which smart pointer represents exclusive ownership with no runtime overhead?

  1. A std::shared_ptr
  2. B std::unique_ptr
  3. C std::weak_ptr
  4. D std::auto_ptr
Answer

std::unique_ptr

unique_ptr cannot be copied, only moved, and occupies the same space as a raw pointer. It should be the default choice.

All C++ MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as