Character Handling: ctype .h
These functions take int arguments, which should be able to be represented as either unsigned char values or as EOF ; the effect of supplying other values is undefined. In Table F.2, "true" is used as shorthand for "a non-zero value." Interpretation of some definitions depends on the current locale setting, which is controlled by the functions of locale.h .
Table F.2. Character-handling functions.
Prototype | Description |
int isalnum (int c); | Returns true if c is alphanumeric (alphabetic or numeric). |
int isalpha (int c); | Returns true if c is alphabetic. |
int iscntrl (int c); | Returns true if c is a control character, such as Ctrl+B. |
int isdigit (int c); | Returns true if c is a digit. |
int isgraph (int c); | Returns true if c is any printing character other than a space. |
int islower (int c); | Returns true if c is a lowercase character. |
int isprint (int c); | Returns true if c is a printing character. |
int ispunct (int c); | Returns true if c is a punctuation character (any printing character other than a space or an alphanumeric character). |
int isspace (int c); | Returns true if c is a whitespace character: space, newline, formfeed, carriage return, vertical tab, horizontal tab, or, possibly, other implementation-defined characters . |
int isupper (int c); | Returns true if c is an uppercase character. |
int isxdigit (int c); | Returns true if c is a hexadecimal-digit character. |
int tolower (int c); | If the argument is an uppercase character, returns the lowercase version; otherwise , just returns the original argument. |
int toupper(int c); | If the argument is a lowercase character, returns the uppercase version; otherwise, just returns the original argument. |