c++ list iterator how code example
Example: traverse through list c++
for (auto it = mylist.begin(); it != mylist.end(); ++it)
cout << ' ' << *it;
for (auto it = mylist.begin(); it != mylist.end(); ++it)
cout << ' ' << *it;