How to make a multi vector in C++
<p>I was wondering why can't I have a multi vectors in C ++ /please take a look at this example, it's not working though.</p>

<p>there are only two parts to the code,  foo function to manipulate the vector and the main function to echo them.</p>

<pre><code>typedef vector&lt; vector&lt;double&gt; &gt; MyVec;

MyVec foo() {
    MyVec v;    

    for (int index=0; index &lt; 2; index ++) {
        for (int j=0; j&lt;5; j++) {
            v[index][j];
        }   
    }

    return v;
}

int main () {
    MyVec z = foo();

    for (int i = 0; i &lt; z.size(); i++) {
        cout &lt;&lt; z[i][1];                    
    }

    return 0;
}
</code></pre>
