title: Why does "std::cout << myVector[x][x] << std::endl" produce a subscript error?
body: <p>This is probably a very simple question, however it is hounding me. 
  I can get the data into the container but I can't then seem to print it to the console.</p>
  
  <p>The following produces a subscript out of range debug error</p>
  
  <p>Here is my code</p>
  
  <pre><code>std::vector&lt;std::vector&lt;int&gt;&gt; myVector;
  
  for (int x = 0; x != 18; x++)
  {
     myVector.push_back(std::vector&lt;int&gt;(x,x));
     std::cout &lt;&lt; myVector[x][x] &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>Many thanks!</p>