Lets we have
std::vector <std::vector <int>> myVec;
myVec.resize(100);
myVec[0].push_back(1);
myVec[0].push_back(2);
When I break the program with a breakpoint, I see that both size and capacity of each myVec[] is zero. Additionally, when I try to access myVec[0][0]
, it gives access violation error. How this could be?
P.S.: I am using VS 10