[Previous]
[Contents]
[Next]

isxdigit()

test for any hexadecimal digit

Synopsis:

#include <ctype.h>
int isxdigit( int c );

Description:

The isxdigit() function tests for any hexadecimal-digit character. These characters are the digits 0 through 9 and the letters a through f and A through F.

Returns:

A nonzero value when the argument is a hexadecimal-digit character, otherwise zero.

Examples:

#include <stdio.h>
#include <ctype.h>

char chars[] = {A, 5, $};

#define SIZE sizeof( chars ) / sizeof( char )

void main()
  {
    int   i;

    for( i = 0; i < SIZE; i++ ) {
      printf( "Char %c is %sa hexadecimal digit"
        " character\n", chars[i],
        ( isxdigit( chars[i] ) ) ? "" : "not " );
    }
  }

produces the output

Char A is a hexadecimal digit character
Char 5 is a hexadecimal digit character
Char $ is not a hexadecimal digit character

Classification:

ANSI

Safety:
Interrupt handler Yes
Signal handler Yes
Thread Yes

See also:

isalnum(), isalpha(), iscntrl(), isdigit(), isgraph(), islower(), isprint(), ispunct(), isspace(), isupper()


[Previous]
[Contents]
[Next]