title: Vector of Vectors to create matrix
body: <p>I am trying to take in an input for the dimensions of a 2D matrix. And then use user input to fill in this matrix. The way I tried doing this is via vectors (vectors of vectors). But I have encountered some errors whenever I try to read in data and append it to the matrix.</p>
  
  <pre><code>//cin&gt;&gt;CC; cin&gt;&gt;RR; already done
  vector&lt;vector&lt;int&gt; &gt; matrix;
  for(int i = 0; i&lt;RR; i++)
  {
      for(int j = 0; j&lt;CC; j++)
      {
      cout&lt;&lt;"Enter the number for Matrix 1";
           cin&gt;&gt;matrix[i][j];
      }
  }
  </code></pre>
  
  <p>Whenever I try to do this, it gives me a subscript out of range error. Any advice?</p>