title: Vector of Vector Initialization
body: <p>I am having a tough time getting my head wrapped around how to initialize a vector of vectors.  </p>
  
  <p>typedef vector&lt; vector &lt; vector &lt; vector&lt; float > > > > DataContainer;</p>
  
  <p>I want this to conform to</p>
  
  <pre><code>level_1 (2 elements/vectors)
     level_2 (7 elements/vectors)
        level_3 (480 elements/vectors)
           level_4 (31 elements of float)
  </code></pre>
  
  <p>Addressing the elements isn't the issue.  That should be as simple as something like</p>
  
  <pre><code>dc[0][1][2][3];
  </code></pre>
  
  <p>The problem is that I need to fill it with data coming in out of order from a file such that successive items need to be placed something like</p>
  
  <pre><code>dc[0][3][230][22];
  dc[1][3][110][6]; //...etc
  </code></pre>
  
  <p>So I need to initialize the V of V beforehand.</p>
  
  <p>Am I psyching myself out or is this as simple as</p>
  
  <pre><code>for 0..1
      for 0..6
          for 0..479
             for 0..30
                 dc[i][j][k][l] = 0.0;
  </code></pre>
  
  <p>It doesn't seem like that should work.  Somehow the top level vectors must be initialized first.</p>
  
  <p>Any help appreciated.  I am sure this must be simpler than I am imagining.</p>