iterate through c++ list 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;