LearnFrenzy
Sign in Take a free test

Smart Pointers · Smart Pointers MCQ · Question 13

Which smart pointer should be the default? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 13 Back to Exercise

Which smart pointer should you choose by default for owning a heap object?

  • A shared_ptr
  • B unique_ptr Correct
  • C weak_ptr
  • D auto_ptr
Correct Answer: Option B

It has no overhead and makes ownership clear; it can be converted to shared_ptr later if needed.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links