title: C++ std::vector vs array in the real world
body: <p>I'm new to C++.  I'm reading &quot;Beginning C++ Through Game Programming&quot; by Michael Dawson.  However, I'm not new to programming in general.  I just finished a chapter that dealt with vectors, so I've got a question about their use in the real world (I'm a computer science student, so I don't have much real-world experience yet).</p>
  <p>The author has a Q/A at the end of each chapter, and one of them was:</p>
  <blockquote>
  <p>Q: When should I use a vector instead of an array?</p>
  <p>A: Almost always.  Vectors are efficient and flexible.  They do require a little more memory than arrays, but this tradeoff is almost always worth the benefits.</p>
  </blockquote>
  <p>What do you guys think?  I remember learning about vectors in a Java book, but we didn't cover them at all in my Intro to Comp. Sci. class, nor my Data Structures class at college.  I've also never seen them used in any programming assignments (Java and C).  This makes me feel like they're not used very much, although I know that school code and real-world code can be extremely different.</p>
  <p>I don't need to be told about the differences between the two data structures; I'm very aware of them.  All I want to know is if the author is giving good advice in his Q/A, or if he's simply trying to save beginner programmers from destroying themselves with complexities of managing fixed-size data structures.  Also, regardless of what you think of the author's advice, what do you <em>see</em> in the real-world more often?</p>