title: Vector unusual number when accessing out of range index
body: <p>I the below code demonstrates strange behaviour when trying to access an out-of-range index in a vector</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  int main()
  {
      std::vector&lt;int&gt; a_vector(10, 0);
  
      for(int i = 0; i &lt; a_vector.size(); i++)
      {
          std::cout &lt;&lt; a_vector[i] &lt;&lt; ", ";
      }
      for(int j = 0; j &lt;= a_vector.size(); j++)
      {
          std::cout &lt;&lt; a_vector[i] &lt;&lt; ", ";
      }
      return 0;
  }
  </code></pre>
  
  <p>The first for loop produces the expected <code>0, 0, 0, 0, 0, 0, 0, 0, 0, 0,</code> output, however the second loop produces <code>0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1318834149,</code>. </p>
  
  <p>The last number produced by the second loop changes every time to code is run, and is always large, unless the length of the vector is between three and seven (inclusive), in which case the last number is 0. It also persists for larger indexes - for example modifying the stop value of the second loop to <code>j &lt;= a_vector.size() + 2000</code> keeps producing large numbers until index 1139, at which point it reverts to 0.</p>
  
  <p>Where does this number come from, does it mean anything, and most importantly why isn't the code throwing an 'out of range' error, which is what I would expect it to do when asked the access the 11th element of a vector 10 elements long</p>