#include #include #include //for class list using namespace std; int main() { list li { 0, 10, 20, 30, 40 }; for (auto value: li) { cout << value << "\n"; } cout << "\n"; //Skip a line. /* If you're planning to make insertions and deletions, you have to loop with an "iterator". You can apply the operators !=, *, and ++ to the iterator, as we do to a pointer. */ for (auto it {begin(li)}; it != end(li); ++it) { cout << *it << "\n"; } cout << "\n"; //Skip a line. int a[] {50, 60, 70, 80, 90}; for (auto p {begin(a)}; p != end(a); ++p) { cout << *p << "\n"; } return EXIT_SUCCESS; }