Format
#include <ctype.h>
/* test for: */
int isalnum(int c); /* alphanumeric character */
int isalpha(int c); /* alphabetic character */
int iscntrl(int c); /* control character */
int isdigit(int c); /* decimal digit */
int isgraph(int c); /* printable character, excluding space */
int islower(int c); /* lowercase character */
int isprint(int c); /* printable character, including space */
int ispunct(int c); /* nonalphanumeric printable character, excluding space */
int isspace(int c); /* whitespace character */
int isupper(int c); /* uppercase character */
int isxdigit(int c); /* hexadecimal digit */
Language Level: ANSI, POSIX, XPG4
These functions test a given integer value c to
determine if it has a certain property as defined by the LC_CTYPE
category of your current locale. The value of c must
be representable as an unsigned char, or EOF.
The functions test for the following:
| isalnum | Alphanumeric character (upper- or lowercase letter, or decimal digit), as defined in the locale source file in the alnum class of the LC_CTYPE category of the current locale. |
| isalpha | Alphabetic character, as defined in the locale source file in the alpha class of the LC_CTYPE category of the current locale. |
| iscntrl | Control character, as defined in the locale source file in the cntrl class of the LC_CTYPE category of the current locale. |
| isdigit | Decimal digit (0 through 9), as defined in the locale source file in the digit class of the LC_CTYPE category of the current locale. |
| isgraph | Printable character, excluding the space character, as defined in the locale source file in the graph class of the LC_CTYPE category of the current locale. |
| islower | Lowercase letter, as defined in the locale source file in the lower class of the LC_CTYPE category of the current locale. |
| isprint | Printable character, including the space character, as defined in the locale source file in the print class of the LC_CTYPE category of the current locale. |
| ispunct | Nonalphanumeric printable character, excluding the space character, as defined in the locale source file in the punct class of the LC_CTYPE category of the current locale. |
| isspace | White-space character, as defined in the locale source file in the space class of the LC_CTYPE category of the current locale. |
| isupper | Uppercase letter, as defined in the locale source file in the upper class of the LC_CTYPE category of the current locale. |
| isxdigit | Hexadecimal digit (0 through 9, a through f, or A through F), as defined in the locale source file in the xdigit class of the LC_CTYPE category of the current locale. |
You can redefine any character class in the LC_CTYPE category of the current locale, with some restrictions.
Return Value
These functions return a nonzero value if the integer
satisfies the test condition, or 0 if it does not.
![]()
![]()
isascii -- Test Integer Values
![]()
_iscsym - _iscsymf -- Test Integer
iswalnum to iswxdigit -- Test Wide
Integer Value
setlocale -- Set Locale
tolower - toupper -- Convert Character
Case
![]()
_toascii -_tolower -_toupper -- Convert
Character
<ctype.h>
LC_CTYPE Locale
Category Source Definition