LearnFrenzy
Sign in Take a free test

Arrays and Vectors · Arrays and Vectors MCQ · Question 7

Main advantage of std::vector over arrays Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links