Checks and converts character types.
In the above functions, if the input parameter value is not within the range that can be represented by the unsigned char type and is not EOF, the operation of the function is not guaranteed.
Character types are listed in table 6.5.
Implementation-Defined Specifications
The character set inspected by the isalnum, isalpha, iscntrl, islower, isprint, and isupper functions |
Character set represented by the unsigned char type (0 to 255) and EOF (-1). Table 7.7 shows the character set that results in a true return value. |
Tests for a letter or a decimal digit.
#include <ctype.h>
long isalnum (long c);
If character c is a letter or a decimal digit: Nonzero
If character c is not a letter or a decimal digit: 0
#include <ctype.h>
long isalpha(long c);
If character c is a letter: Nonzero
If character c is not a letter: 0
Tests for a control character.
#include <ctype.h>
long iscntrl (long c);
If character c is a control character: Nonzero
If character c is not a control character: 0
#include <ctype.h>
long isdigit (long c);
If character c is a decimal digit: Nonzero
If character c is not a decimal digit: 0
Tests for any printing character except space (’ ’).
#include <ctype.h>
long isgraph (long c);
If character c is a printing character except space: Nonzero
If character c is not a printing character except space: 0
#include <ctype.h>
long islower (long c);
If character c is a lowercase letter: Nonzero
If character c is not a lowercase letter: 0
Tests for a printing character including space (’ ’).
#include <ctype.h>
long isprint (long c);
If character c is a printing character including space: Nonzero
If character c is not a printing character including space: 0
Tests for a special character.
#include <ctype.h>
long ispunct (long c);
If character c is a special character: Nonzero
If character c is not a special character: 0
Tests for a white-space character.
#include <ctype.h>
long isspace (long c);
If character c is a white-space character: Nonzero
If character c is not a white-space character: 0
Tests for an uppercase letter.
#include <ctype.h>
long isupper (long c);
If character c is an uppercase letter: Nonzero
If character c is not an uppercase letter: 0
Tests for a hexadecimal digit.
#include <ctype.h>
long isxdigit (long c);
If character c is a hexadecimal digit: Nonzero
If character c is not a hexadecimal digit: 0
Converts an uppercase letter to the corresponding lowercase letter.
#include <ctype.h>
long tolower (long c);
If character c is an uppercase letter: Lowercase letter corresponding to character c
If character c is not an uppercase letter: Character c
Converts a lowercase letter to the corresponding uppercase letter.
#include <ctype.h>
long toupper (long c);
If character c is a lowercase letter: Uppercase letter corresponding to character c
If character c is not a lowercase letter: Character c
Tests for a space character or a tab character.
#include <ctype.h>
long isblank (long c);
If character c is a space character or a tab character: Nonzero
If character c is neither a space character nor a tab character: 0