ctype.h
The ctype.h
header provies functionality to classify and transform characters.
Functions
The char
data type is implicitly cast to int
. The functions in this header are affected by the currently installed C locale.
Classification
The classification functions return 0 if false, otherwise a nonzero value if true.
int isalnum(int c);
- is alphanumeric character
int isalpha(int c);
- is alphabetical character
int isblank(int c);
- is blank character
int iscntrl(int c);
- is control character
int isdigit(int c);
- is decimal digit
int isgraph(int c);
- is graphically representable
int islower(int c);
- is lower case letter
int isprint(int c);
- is printable
int ispunct(int c);
- is punctuation character
int isspace(int c);
- is white space character
int isupper(int c);
- is upper case letter
int isxdigit(int c);
- is hexadecimal digit
Conversion
The conversion functions return the converted letter as int
which can be implicitly cast as char
.
int tolower(int c);
- to lower case letter
int toupper(int c);
- to upper case letter