I have modified a menu program, but if you enter an invalid input (with the exception of an invalid integer) it goes into an infinite loop.
I would like to know how to fix this.
Sorry, I am new to programming. If I were to simply copy and paste that code into line 19 would it work or would I have to work it into the program in a more complicated way?
Edit: I tested that and it works, but instead of returning the user to the menu it simply displays their invalid input. Also any input afterwards (correct or not) does the same thing and displays their invalid input.
Oh, of course. Thank you.
Edit: I am having the same issue as earlier. Instead of returning the user to the menu it displays their input.
Edit 2: I think I solved it. cin.ignore (256); I changed that 256 to 1 and it seems to work now. Going to play with it some more and make sure it works.