-
vector of vectors
It tried using a vector of vectors, but for some reason it woouldn't compile. Can't remember the error, something about a missing comma I think.
Code:
std::vector<std::vector<int>> MyVec;
Either I'm making some stupid obvious mistake, or it's not possible this way.
On a side-related note, I used a typedef and it compiled fine:
Code:
typedef std::vector<int> vec_int;
std::vector<vec_int> MyVec;
Why is the first not valid?
-
You need to put a space between those last '>' otherwise it's seen as the '>>' operator, ie: Code:
std::vector<std::vector<int> > MyVec;
-
*Ouch*
Yeah, that makes sense.
Thanks!