Reputation: 13
I have a problem at this line
cout << "Please input how many hours your pool pump ran this month: ";
cin.get(hours,15);
cin.ignore(80,'\n');
around there the program skips over were you would enter your hours. I can't find solution of the problem if You want to see the whole code it is on my other posts. Thank you. :)
Upvotes: 1
Views: 55
Reputation: 8614
You should do it simpler like this:
int hours = 0;
cout << "Please input how many hours your pool pump ran this month: "
cin >> hours;
For reasons why your code didn't work as expected, check the cin.get()
and cin.ignore()
documentation:
http://www.cplusplus.com/reference/istream/istream/get/ http://www.cplusplus.com/reference/istream/istream/ignore/
Upvotes: 1