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