This section explains the library functions for performing conversions such as case mappings on characters. For example, toupper
converts any character to upper case if possible. If the character can't be converted, toupper
returns it unchanged.
These functions take one argument of type int
, which is the character to convert, and return the converted character as an int
. If the conversion is not applicable to the argument given, the argument is returned unchanged.
Compatibility Note: In pre-ANSI C dialects, instead of returning the argument unchanged, these functions may fail when the argument is not suitable for the conversion. Thus for portability, you may need to write islower(c) ? toupper(c) : c
rather than just toupper(c)
.
These functions are declared in the header file `ctype.h'.
tolower
returns the corresponding lower-case letter. If c is not an upper-case letter, c is returned unchanged.
tolower
returns the corresponding upper-case letter. Otherwise c is returned unchanged.
unsigned char
value that fits into the US/UK ASCII character set, by clearing the high-order bits. This function is a BSD extension and is also an SVID extension.
tolower
, and is provided for compatibility with the SVID. See SVID.
toupper
, and is provided for compatibility with the SVID.