9.3. Character handlingThere are a variety of functions provided for testing and
mapping characters. The testing functions, which are
described first, allow you to test if a character is of a
particular type, such as alphabetic, upper or lower case,
numeric, a control character, a punctuation mark, printable
or not and so on. The character testing functions return an
integer, either zero if the character supplied is not of the
category specified, or non-zero if it was. The functions
all take an integer argument, which should either be an int,
the value of which should be representable as These functions depend on the program's locale setting. A printing character is a member of an implementation
defined character set. Each printing character occupies one
printing position. A control character is a member of an
implementation defined character set, each of which is not a
printing character. If the 7-bit ASCII character set is used, the printing
characters are those that lie between space The following is a summary of all the character testing
functions. The header
Two additional functions map characters from one set into
another. The function
tolower('A') == 'a'
If The converse function For each, the conversion is only performed if there is a corresponding character in the alternate case. In some locales, not all upper case characters have lower case equivalents, and vice versa. |
The C BookThis book is published as a matter of historical interest. Please read the copyright and disclaimer information. GBdirect Ltd provides up-to-date training and consultancy in C, Embedded C, C++ and a wide range of other subjects based on open standards if you happen to be interested. |
|
West Yorkshire Office
GBdirect Ltd
Training: 0800 651 0338 Please call between 0900 and 1700 (UK time) on Monday to Friday South East Regional Office
GBdirect Ltd
Training: 0800 651 0338 Please call between 0900 and 1700 (UK time) on Monday to Friday Please note: |