C Programming/ctype.h/Function reference


isalnum

edit

Prototype

edit
int isalnum(int c);

Description

edit

This function tests whether the character c is of class alpha or digit in the current locale.

isalpha

edit

Prototype

edit
int isalpha(int c);

Description

edit

This function tests whether the character c is alphabetic in the current locale.

isblank

edit

Prototype

edit
int isblank(int c);

Description

edit

This function tests whether the character c is a space or a tab in the current locale.

iscntrl

edit

Prototype

edit
int iscntrl(int c);

Description

edit

This function returns true if c is a control character (that is, a character that is not a printing character).

isdigit

edit

Prototype

edit
int isdigit(int c);

Description

edit

This function returns true if c is a decimal digit ('0' through '9').

isgraph

edit

Prototype

edit
int isgraph(int c);

Description

edit

This function returns true if c is a character that has a glyph associated with it. Whitespace characters are not considered graphic.

islower

edit

Prototype

edit
int islower(int c);

Description

edit

This function tests whether the character c is lowercase.

isprint

edit

Prototype

edit
int isprint(int c);

Description

edit

This function returns true if c is a printing character. Printing characters include all the graphic characters, plus the space character.

ispunct

edit

Prototype

edit
int isalnum(int c);

Description

edit

This function returns true if c is a punctuation character. This includes any printing character that is not alphanumeric or a space character.

isspace

edit

Prototype

edit
int isspace(int c);

Description

edit

Returns true if c is a whitespace character. In the standard C locale, these are the valid space characters:

  • Spaces
  • Horizontal tabs
  • Vertical tabs
  • Newlines
  • Formfeeds
  • Carriage returns

isupper

edit

Prototype

edit
int isupper(int c);

Description

edit

This function tests whether the character c is uppercase.

isxdigit

edit

Prototype

edit
int isxdigit(int c);

Description

edit

This function tests whether the character c is a hexadecimal dight ('0' through 'F').

tolower

edit

Prototype

edit
int tolower(int c);

Description

edit

This function transliterates an uppercase character to lowercase and returns it. If c is not an uppercase letter, c is returned unchanged.

toupper

edit

Prototype

edit
int toupper(int c);

Description

edit

This function transliterates a lowercase character to uppercase and returns it. If c is not a lowercase letter, c is returned unchanged.