Hi,
Just wondering, In c, if i use this code snippit:
Code:
int value;

printf("Please enter a value: ");
scanf("%d", &value);
how can i then check that value is a numeric value, i know that by declaring it as int it should be numeric, but i have made a menu system that dispalys some options and the user has to enter a number that currosponds to the selection they want to use.

This works great if the user enters a number, but if a user hits a letter key by mistake, then the menu is just displayed over and over again, without stopping.

Maybe i need a way to allow the user to only enter numbers and no letters, is that a possibility, and if so, could you please post some sample code for me (the code needs to be in c, and will be used in a console app)..


Thanks for your help.

-|- Hurgh -|-