# C++ Notes: Character functions - <cctype>

## Character functions - <cctype>

Here are some of the most common functions to with single characters. The types of the parameters are c=`char/int`. Some parameters have the `const` attribute, but it's not indicated below.

Because these are the original C functions, `bool` isn't used. Instead, zero is false and non-zero is true.

Type | Method | Description
--- | --- | ---
`#include <cctype>` (or older `<ctype.h>`)
int | `isalnum(c)` | true if c is a letter or digit.
int | `isalpha(c)` | true if c is a letter.
int | `isblank(c)` | true if c is a blank or tab.
int | `isdigit(c)` | true if c is a digit.
int | `islower(c)` | true if c is a lowercase letter.
int | `isupper(c)` | true if c is an uppercase letter.
int | `isspace(c)` | true if c is whitespace character (space, tab, vertical tab, formfeed, carriage return, or newline).
int | `tolower(c)` | returns lowercase version of c if there is one, otherwise it returns the character unchanged.
int | `toupper(c)` | returns uppercase version of c if there is one, otherwise it returns the character unchanged.