std::isxdigit
Header: <cctype>
Checks if the given character is a hexadecimal numeric character (0123456789ABCDEFabcdef).
# Declarations
int isxdigit( int ch );
# Parameters
ch: character to classify
# Return value
Non-zero value if the character is a hexadecimal numeric character, zero otherwise.
# Notes
std::isdigit and std::isxdigit are the only standard narrow character classification functions that are not affected by the currently installed C locale. although some implementations (e.g. Microsoft in 1252 codepage) may classify additional single-byte characters as digits.
Like all other functions from
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
#include <cctype>
#include <climits>
#include <iostream>
int main()
{
for (int c = 0; UCHAR_MAX >= c; ++c)
if (isxdigit(c))
std::cout << static_cast<char>(c);
std::cout << '\n';
}