S
Sokar
Hello,
I was wondering if anyone could help me out. I have devised a wee
menu system with 5 options. the way to select an option is to select
a number 1 - 5 and then there is a switch block to implement some code
depending on the selection. before the program goes into the switch i
have an if statement which checks the see if the input from the user
is greater than 5 "if(choice > 5)" if so then it calls the main
function and goes back to the start. If not then it goes into the
switch statement.
The problem is that if the user enters a letter as their choice
instead of a number the program goes into a forever loop and keeps
displaying the menu over and over again.
I was wondering if anyone know how I could test to see if the entry by
the user was either greater than 5 or not numerical in value.
Thanks and regards
John
I was wondering if anyone could help me out. I have devised a wee
menu system with 5 options. the way to select an option is to select
a number 1 - 5 and then there is a switch block to implement some code
depending on the selection. before the program goes into the switch i
have an if statement which checks the see if the input from the user
is greater than 5 "if(choice > 5)" if so then it calls the main
function and goes back to the start. If not then it goes into the
switch statement.
The problem is that if the user enters a letter as their choice
instead of a number the program goes into a forever loop and keeps
displaying the menu over and over again.
I was wondering if anyone know how I could test to see if the entry by
the user was either greater than 5 or not numerical in value.
Thanks and regards
John