Reputation: 474
Simply, I have a vector:
vector<vector<int>> myvector
For this example it would look like this:
myvector[
vector{1,2,3}
vector{1,2,3,4,5}
vector{1,2}
]
How would one go about adding a number such as 4 to the first vector inside myvector to make it look like below?:
myvector[
vector{1,2,3,4}
vector{1,2,3,4,5}
vector{1,2}
]
Upvotes: 0
Views: 55
Reputation: 4181
you can access to them with indexes:
vectorOne[index].push_back(1);
More info:
http://www.cplusplus.com/reference/vector/vector/
http://www.cplusplus.com/forum/beginner/12409/
Upvotes: 0