Skip to content

Latest commit

 

History

History
66 lines (50 loc) · 1.59 KB

020b_isalpha.asciidoc

File metadata and controls

66 lines (50 loc) · 1.59 KB

isalpha

#include <ctype.h>

int isalpha   (char c);
int isalpha_l (int c, locale_t locale);
DESCRIPTION

Checks if the given character is an alphabetic character, i.e., either an uppercase letter (ABCDEFGHIJKLMNOPQRSTUVWXYZ), or a lowercase letter (abcdefghijklmnopqrstuvwxyz).

In locales other than "C", an alphabetic character is a character for which isupper() or islower() returns true or any other character considered alphabetic by the locale. In any case, iscntrl(), isdigit(), ispunct() and isspace() will return false for this character.

The behavior is undefined if the value of c is not representable as unsigned char and is not equal to EOF.

RETURN VALUE

Non-zero value (true) if the character is an alphabetic character, 0 (false) otherwise.

SEE ALSO

isalnum, isblank, iscntrl, isdigit, isgraph, islower, isprint, ispunct, isspace, isupper, isxdigit

EXAMPLE
link:src/isalpha1.c[role=include]
OUTPUT
$ gcc -Wall isalpha1.c
$ ./a.out
isalpha (?) NO
isalpha (@) NO
isalpha (A) YES
isalpha (B) YES
EXAMPLE
link:src/isalpha2.c[role=include]
OUTPUT
$ gcc -Wall isalpha2.c
$ ./a.out
isalpha('\xdf') in default C locale returned 0
isalpha('\xdf') in ISO-8859-1 locale returned 1