#include #include #include //for class list using namespace std; int main() { list li; //Born empty, but capable of holding ints. for (;;) { cout << "Please input an int (or control-d when done): "; int i {0}; cin >> i; if (!cin) { //if the user typed control-d, break; //out of the for loop } li.push_back(i); //Call mem function push_back belonging to li } cout << "\n\n"; cout << "Here are the " << li.size() << " ints that you input:\n"; for (auto i: li) { cout << i << "\n"; //i is an int because li holds ints. } return EXIT_SUCCESS; //Nothing we have to remember to delete. }