i may have a very simple question, please forgive me if this is a newbie question.
i have a menu that uses an int that i cin and then uses a switch to determine the course of action. how can i prevent or handle the user entering a char? i already am using cin.good() to determine that they entered anything at all, but i need to make sure they are entering a valid int.
is there an easy way to do this?
this is a console app
i have a menu that uses an int that i cin and then uses a switch to determine the course of action. how can i prevent or handle the user entering a char? i already am using cin.good() to determine that they entered anything at all, but i need to make sure they are entering a valid int.
is there an easy way to do this?
this is a console app