std::isalnum (3) - Linux Manuals
std::isalnum: std::isalnum
NAME
Synopsis
Defined in header <cctype>
int isalnum( int ch );
Checks if the given character is an alphanumeric character as classified by the current C locale. In the default locale, the following characters are alphanumeric:
* digits (0123456789)
* uppercase letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ)
* lowercase letters (abcdefghijklmnopqrstuvwxyz)
The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.
Parameters
ch - character to classify
Return value
Non-zero value if the character is an alphanumeric character, 0 otherwise.
Notes
Like all other functions from <cctype>, the behavior of std::isalnum is undefined if the argument's value is neither representable as unsigned char nor equal to EOF. To use these functions safely with plain chars (or signed chars), the argument should first be converted to unsigned char:
Similarly, they should not be directly used with standard algorithms when the iterator's value type is char or signed char. Instead, convert the value to unsigned char first:
Example
Demonstrates the use of isalnum() with different locales (OS-specific).
// Run this code
Possible output:
See also
isalnum(std::locale) (function template)