how to pushback a 2D vector

118 Views Asked by At

let's say I have a vector storing vectors of strings. std::vector<std::vector<std::string>> MyVec = { {}, {} }

I want to use anything equivalent to .push_back(X) such that the vector will now look as following: { {X}, {} }.

Does anyone have an idea for a way to solve this?

1

There are 1 best solutions below

0
On BEST ANSWER

MyVec[0].push_back(x) by @MikeCAT worked.