title: Does resizing a vector invalidate iterators?
body: <p>I found that this C++ code:</p>
  
  <pre><code>vector&lt;int&gt; a;
  a.push_back(1);
  a.push_back(2);
  vector&lt;int&gt;::iterator it = a.begin();
  a.push_back(4);
  cout &lt;&lt; *it;
  </code></pre>
  
  <p>print some big random number; but if you add <code>a.push_back(3)</code> between 3rd and 4th lines, it will print 1. Can you explain it to me?</p>