Hi,
I have a problem with my small program when run closing down before it's ran through all the stages? My code is:
It lets me enter the initial numbers, however when i exit the while loop (by entering a non integer), the program then just asks me to pres any key to exit (my system pause line), however it completely misses out the 2nd cin code line? Any ideas why this is? No error messages are coming up either.Code:vector<int> numbers; cout << "Please enter a list of numbers "; int temp; while(cin>>temp) numbers.push_back(temp); cout << "How many elements do you wish to sum? "; int sum; cin >> sum; system("pause");
Thanks.