cout<<"The mean is "<<avg(list)<<endl;
cout<<"The standard deviation is "<<std_dev(list)<<endl;
When I run this program, it terminates after printing "Again? (y/n)". This happens to me every time I try to read in numbers, put them into a vector using push_back, and then try to get something from the user later. Like if I took out that cin>>response line and had the program go on to do other things that don't involve getting input from the user, then the program would keep running. So I guess there is something wrong with my while loop. Any help would be appreciated.
Question is how do you escape the loop on line 11-13? I guess you input something that is not a number. When it fails to read a double it will set the failbit of cin. To be able to read input again you need to clear the failbit. cin.clear();
The input that you entered to make the loop stop is still in cin so if you try to read a string now the string will get this value. To remove the old input before you read the string you can use the ignore function.
// Ignores one character.
// Ignores the whole line.