test to see if a character is a letter
#include <ctype.h> int isalpha( int c );
The isalpha() function tests if the argument c is an alphabetic character ('a' to 'z' and 'A' to 'Z'). An alphabetic character is any character for which isupper() or islower() is true.
Zero if the argument isn't an alphabetic character; otherwise, a nonzero value.
#include <stdio.h>
#include <ctype.h>
void main()
{
if( isalpha( getchar() ) ) {
printf( "is alphabetic\n" );
}
}
ANSI
| Safety: | |
|---|---|
| Interrupt handler | Yes |
| Signal handler | Yes |
| Thread | Yes |
isalnum(), iscntrl(), isdigit(), isgraph(), islower(), isprint(), ispunct(), isspace(), isupper(), isxdigit()