#include #include #include //for class vector using namespace std; int main() { vector v; //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 } v.push_back(i); //Call member function push_back belonging to v } cout << "\n\n"; cout << "Here are the " << v.size() << " ints that you input:\n"; for (auto i: v) { cout << i << "\n"; //i is an int because v holds ints. } return EXIT_SUCCESS; //Nothing we have to remember to delete. }