0

What are the performance differences between a vector and array?

I had always believed arrays to be faster. However, I've recently heard many people say there is no difference. Is this actually true? Are the differences constant for both small and large arrays? Thank you in advance.

  • Arrays on the stack are faster, but limited by stack size, and size must be known at compile time. Vectors are slower, but re-sizable, safer, and use heap memory. – Cory Kramer Jul 02 '15 at 19:03
  • http://stackoverflow.com/questions/381621/using-arrays-or-stdvectors-in-c-whats-the-performance-gap and http://stackoverflow.com/questions/3664272/stdvector-is-so-much-slower-than-plain-arrays probably answer your question. – Brian Vandenberg Jul 02 '15 at 19:03

0 Answers0