Answer the question
In order to leave comments, you need to log in
How exactly does this list constructor work?
What is the result of the given string, a list in which each element is a vector? list<vector<string>> lvs;
And how to access the elements, in this case?
Answer the question
In order to leave comments, you need to log in
What is the result of this line
list<vector<string>> lvs {{"Hello", "World"}, {"Goodbye", "Universe"}, {"What", "am", "I", "doing"}};
for(auto it = list.cbegin(), it != list.cend(), ++it) {//Проходимся по всем элементам списка
cout << (*it)[1] << '\n';
// (*it) даст элемент списка: vector<string>
// Пы можем обратиться к элементу вектора при помощи оператора []
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question