title: How to resize dynamically a two dimentional vector?
body: <p>I need to resize a two dimensional vector (of unknown size) as follows: </p>
  
  <pre><code>//Creating the vector of vectors: 
  
  vector&lt; vector&lt; long &gt; &gt; v;
  
  //Resizing the vectors:
  
  /*Needing help here: 
  
  my current assumption is: 
  v.resize(1);
  v[0].resize(1);
  */
  
  //Adding elements:
  
  v[0][0].push_back(0); 
  v[0][1].push_back(-1); 
  </code></pre>
  
  <p>The compiler is reporting error upon applying the push_back. I think i have a problem in resizing the vector. </p>
  
  <p>The objective is creating a two dimensional vector that allocates memory dynamically according to the added values. </p>
  
  <p>Thanks in advance for your help</p>