Question 15
Back to Exercise
After v.clear(), what is true?
- A size is 0 and the memory is always released
- B size is 0 but the capacity is normally kept Correct
- C size is unchanged
- D The vector is destroyed
Correct Answer: Option B
Keeping the buffer makes refilling cheap. Call shrink_to_fit() if the memory must be returned.
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!