You should NOT check for a digit by its ascii value (nothing says the computer has to use ascii) and even then the code shown won't work...
I'm not totally sure I understand the original question. Maybe posting some of the code you are working on would help explain.
In the meantime take a look at this:
Code:
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
void checkChar(char ch)
{
if (isdigit(ch)) {
printf("%c is a number\n", ch);
}
else {
printf("%c is not a number\n", ch);
}
}
int main ( void )
{
char c1 = 'a';
char c2 = '3';
checkChar(c1);
checkChar(c2);
return 0;
}
HTH