title: handling a 2 dimensional vector c++
body: <p>I need to set up and access a two dimensional vector of structure in C++.
  My structure is defined as:</p>
  
  <pre><code>struct nodo{
    int last_prod;
    int last_slot;
    float Z_L;
    float Z_U;
    float g;
    bool fathomed;
  };
  </code></pre>
  
  <p>I defined the vector as:</p>
  
  <pre><code>vector&lt;vector&lt;struct nodo&gt; &gt; n_2;
  </code></pre>
  
  <p>Now,I need to create several elements of n_2, which will then be vectors again, and then access the single members of them.
  How can I achieve that? that is the piece of code I have so far:</p>
  
  <pre><code>for(int i=1;i&lt;112;i++){
      n_2.push_back(vector&lt;struct nodo&gt;(111-i));       
      for(int j=1;j&lt;112-i;j++){
        n_2[i][j].last_prod=j;
      }
  }
  </code></pre>
  
  <p>which doesn't work.</p>