I have a vector of strings and i want to put this vector of strings inside another vector, so I do:
std::vector<std::string> vect_aux; // my vector of strings
std::vector<std::vector> vect_mat; // my vector of vectors - this is give me error that is: type argument 2 invalid. I do not understand why. Can someone give me a tip?
One more thing, to put a vector inside another we have to do:
vect_mat[0] = vect_aux;
std::vector<std::string> vect_aux; // my vector of strings
std::vector<std::vector<std::string> > vect_mat; // my vector of vectors
to put one inside another i was also thinking in:
vect_mat.push_back(vect_aux);
To search inside of my vector of vector I was thinking in a cycle for like:
for (size_t n = 0; n < vect_mat.size(); n++)
EV << '''' << vect_mat[n] << '"' << '\n';
The loop is not working since it's a two dimensional vector. So you need nested loops:
1 2 3 4 5 6
for (size_t n = 0; n < vect_mat.size(); n++)
{
for (size_t m = 0; m < vect_mat[n].size(); m++)
EV << '"' << vect_mat[n][m] << '"' << '\n'; // Note: '"' not ''''
}
}