Original Post
The following piece of code works if the user enters an interger, but... How can i make it so the program will not crash when a user enters a char? for example the user enters "g" and instead of crashing it displays "invalid choice pick again" int validation(void) { int menu_choice; while(1) { cin >> menu_choice; if(menu_choice == 1 || menu_choice == 2 || menu_choice == 3) { return(menu_choice); } else { cout<<"invalid choice pick again "; } } }