Question 8
Back to Exercise
What does capacity() of a vector report?
- A The number of elements
- B How many elements fit in the allocated storage before a reallocation is needed Correct
- C The maximum possible size
- D The size in bytes
Correct Answer: Option B
capacity ≥ size always. size counts elements actually stored.
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!