Question: How do I determine if a `char` in C such as `a` or `9` is a number or a letter?

Is it better to use:

```
int a = Asc(theChar);

```

or this?

```
int a = (int)theChar

```

Answer: 
chars are just integers, so you can actually do a straight comparison of your character against literals:

```
if( c >= '0' && c <= '9' ){

```

This applies to all characters. [See your ascii table](http://www.asciitable.com/).

[ctype.h](http://www.acm.uiuc.edu/webmonkeys/book/c_guide/2.2.html) also provides functions to do this for you.
You can normally check for ASCII letters or numbers using simple conditions

```
if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
{
    /*This is an alphabet*/
}

```

For digits you can use 

```
if (ch >= '0' && ch <= '9')
{
    /*It is a digit*/
}

```

But since characters in C are internally treated as [ASCII values](http://codeforwin.org/2015/05/ascii-codes.html) you can also use ASCII values to check the same.

[How to check if a character is number or letter](http://codeforwin.org/2015/05/c-program-to-check-alphabet-digit-special-character.html)