ctype.h
This page was translated by a robot.
When programming with C or C++, character strings are often used, which represent a sequence of individual characters. The individual characters are usually charhandled with the type and interpreted as ASCII characters . The standard library ctypehelps to work with these characters, noting that ONLY single 7-bit ASCII characters are explicitly supported with this library.
Identifying ASCII Types
The following functions return either 0or 1depending on whether the passed ASCII character matches the criteria.
To illustrate which values are returned by which function, the following is a list in tabular form. The various ASCII characters are shown horizontally, sorted by coding.
It should be noted that the ASCII character set is only 0 - 127defined for values of . Thus, any number not in this range is not considered an ASCII character, and all functions return in this case 0.
The following functions can also be found in the library header, but these functions (from the author's point of view) seem to have lost their original meaning and are no longer useful today:
Conversion of Characters
In addition to identification functions, the ASCII library also has functions that convert characters:
The functions tolowerand toupperonly convert letters explicitly. All other characters are returned without modification. The function toasciisimply deletes all bits that do not belong to the lowest 7 bits of the ASCII standard. The function digittointconverts a single hexadecimal digit to its numeric representation.