C Data Type Functions - C isxdigit






Determines if a character is hex digit (0?9, A?F, a?f).

Prototype

int isxdigit( int ch );

Parameters

ch - character to classify

Return value

Non-zero value if the character is an hexadecimal numeric character, zero otherwise.

Example


#include <stdio.h>
#include <ctype.h>
#include <limits.h>
 
int main(void){
    for (int ndx=0; ndx<=UCHAR_MAX; ndx++)
        if (isxdigit(ndx)) printf("%c", ndx);
    printf("\n");
}

The code above generates the following result.