traverse a list c++ 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;