title: Allocating a vector vs. a pointer to a vector
body: <p>Say I have two sets of code,</p>
  
  <pre><code>std::vector&lt;float&gt;v1;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>std::vector&lt;float&gt; *pV2 = new std::vector&lt;float&gt;(10);
  </code></pre>
  
  <p>What is the difference between the two other than the fact that you will have a larger chunk of memory allocated with the pointer to the vector? Is there an advantage to one vs. the other?</p>
  
  <p>In my mind, it seems like allocating the pointer is just more of a hassle because you have to deal with deallocating it later.</p>