Reading/writing to file- trouble with if statement

1
Last edited on
You probably have std::cin in a bad state after line 36. Try skipping the dodgy input by adding the following code after line 36, so it looks like:

1
2
cin >> ans;
cin.ignore(numeric_limits<streamsize>::max(), '\n');


Remember to #include <limits>
Topic archived. No new replies allowed.