how to iterate through a list c++ code example
Example 1: traverse through list c++
for (auto it = mylist.begin(); it != mylist.end(); ++it)
cout << ' ' << *it;
Example 2: c++ loop trhought object
for (auto const& i : data) {
std::cout << i.name;
}