title: How to implement 2D vector array?
body: <p>I'm using the vector class in the STL library for the first time. How should I add to a specific row of the vector array?</p>
  
  <pre><code>struct x{
       vector &lt;vector &lt;int&gt; &gt; v;
       int row;
   };
  
  vector&lt; int* &gt; my ints;
  int add;
  </code></pre>
  
  <p>if i wanted to add to first row of v with the first pointer of integers, could I do </p>
  
  <pre><code>myints[0]-&gt;v[myints[0]-&gt;row].push_back(add);
  </code></pre>
  
  <p>Is this method fine to create a 2 D vector of vector <code>int</code>s where each row could potentially be of different length (i.e. have a different number of columns)?</p>