Q:

How to Iterate through Vector of Vectors and Display the output in cpp

I have created a simple class with two variables
class myclass
{
    string Var1;
    string Var2;
};

Now I have created a vector which stores multiple objects of this class
vector <myclass> myvector;

Now I will create one more vector which will have contain the group of vectors(i.e vector of vectors)
vector <vector <myclass>> myvectorofvectors;

Now I need a way to read each elements and print on output screen, how can I achieve this in C++98?

A:

For C++98 use:
    vector< vector<myclass> >::iterator row;
    vector<myclass>::iterator col;

    for (row = myvectorofvectors.begin(); row != myvectorofvectors.end(); row++) {
        for (col = row->begin(); col != row->end(); col++) {
            // do stuff ...
        }
    }

