vector of list in c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

vector of list in c++

Hello, I got something like that vector<list<string>> how to add a string to a first list in side first vector container.

21st Mar 2018, 1:09 PM
mercin
mercin - avatar
1 Answer
+ 3
vec[0].push_front(str) or vec[0].push_back(str) the first adds string to the beginning of the list, the second to its end
21st Mar 2018, 1:52 PM
michal