C Library Functions

Although many of the C library functions are no longer necessary in modern C++ code, you will probably see them in older code. In general, the C library header <name.h> is <cname> in C++, and the functions appear in the std namespace. Some parts of the C library, such as the <cctype> routines and the mathematical functions, remain as essential as always.

Character Classification: <cctype>

The following are fast and portable ways to classify characters, and they return nonzero if they are true. Their use is discussed in Chapter 4, in the section “Classifying Characters.”

 isalpha(ch) islower(ch) or isupper(ch) isalnum(ch) isalpha(ch) or isdigit() isdigit(ch) '0'..'9' isxdigit(ch) hexadecimal digit islower(ch) lower-case letter ...

Get C++ By Example: UnderC Learning Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.