Name

isxdigit - character classification routines

Library

libc.lib

Synopsis

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

Return values

The isxdigit function returns non-zero if ’c’ is a character used for hex-representation and zero otherwise.

The iswxdigit function should be used instead.


Detailed description

The isxdigit function tests if ’c’ is a hexadecimal-digit character. Regardless of locale, this includes the following characters only:

‘‘0’’  ‘‘1’’   ‘‘2’’   ‘‘3’’   ‘‘4’’
‘‘5’’ ‘‘6’’   ‘‘7’’   ‘‘8’’   ‘‘9’’
‘‘A’’ ‘‘B’’   ‘‘C’’   ‘‘D’’   ‘‘E’’
‘‘F’’ ‘‘a’’   ‘‘b’’   ‘‘c’’   ‘‘d’’
‘‘e’’ ‘‘f’’
 


Examples

#include<ctype.h> //isxdigit()
#include<stdio.h> //printf()
int test_isxdigit()
{
   int arr[]={’F’,’a’,’M’,’9’,’2’};
   int i = 0;
   int size = 5;
   for( i=0; i<size; i++)
   {
      int ret = isxdigit(arr[i]); //call to the API with chars in arr[]
      if( (!ret) != 0 )
      {
          printf("\n%c is not hex-digit ", arr[i]);
      }
      else
      {
          printf("\n%c is hex-digit", arr[i]);
      }
}
printf("\n");
}


Output

F is hex-digit
a is hex-digit
M is not hex-digit
9 is hex-digit
2 is hex-digit


See also

iswxdigit, defns

Feedback

For additional information or queries on this page send feedback

© 2008 Nokia Corporation. All rights reserved. This documentation can be used in the connection with this Product to help and support the user.

Top