i have this to check for numeric inputs, which returns then menu if a number is entered less or grater than 5 but how would you do this with alphabets ? for any alphabet or any other charterer apart from numbers should return the menu

while (select < 1 || select > 5) ;
	        return select;

i dont want the program to accept alphabets only numbers

Edited 5 Years Ago by moroccanplaya: n/a

If you're using an Edit control on a Dialog, just set the properties to numeric. If not, in ctype.h there is the function isdigit.

while (select < 'A' || select > 'E')

Single quotes denote the character

i dont want the program to accept alphabets only numbers

You could look at my suggestion and maybe convert it into something you can use.

That's the idea behind programming. Take something similar and make it fit your situation.

Alphabet input can be checked by conforming that whether the input given is a character or not by comparing the input with the ASCII Codes of the alphabets if the inputs's ACSII code is in between the Charter's ASCII CODES series then the input provided is the character

Alphabet input can be checked by conforming that whether the input given is a character or not by comparing the input with the ASCII Codes of the alphabets if the inputs's ACSII code is in between the Charter's ASCII CODES series then the input provided is the character

Man, those translation sites really do a great job, don't they?

i dont want the program to accept alphabets only numbers

isdigit()

Edited 5 Years Ago by TomaCukor: n/a

This article has been dead for over six months. Start a new discussion instead.