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!