Character Functions

These functions test or convert characters. All these functions are implemented both as macros and as functions, and, by default, the macros are active. To use the corresponding function, you have to #undefine the macro.

Listing: ANSI-C Character Functions
int isalnum(int ch);
int isalpha(int ch);

int iscntrl(int ch);

int isdigit(int ch);

int isgraph(int ch);

int islower(int ch);

int isprint(int ch);

int ispunct(int ch); 
int isspace(int ch); 
int isupper(int ch); 
int isxdigit(int ch); 
int tolower(int ch); 
int toupper(int ch);

The ANSI library also defines an interface for multiple-byte and wide characters. The implementation only offers minimal support for this feature: the maximum length of a multiple-byte character is one byte.

int    mblen(char *mbs, size_t n);

size_t mbstowcs(wchar_t *wcs, const char *mbs, size_t n);

int    mbtowc(wchar_t *wc, const char *mbc, size_t n);

size_t wcstombs(char *mbs, const wchar_t *wcs size_t n);

int    wctomb(char *mbc, wchar_t wc);