Question 7
Back to Exercise
What is the main advantage of std::vector over a C array?
- A Faster element access
- B Its size can change at run time and it manages its own memory Correct
- C It uses less memory
- D It can store mixed types
Correct Answer: Option B
Access is equally fast (both are contiguous). The vector grows and shrinks and frees its memory automatically.
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!