title: STL vector: resize() and assign()
body: <p>Having a class members <code>std::vector&lt;double&gt; v</code> and <code>int n</code>, what is the difference between using the following on this <code>vector</code>, which is not initialized:</p>
  
  <pre><code>v.assign(n, 0.0);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>v.resize(n, 0.0);
  </code></pre>