Name

iswxdigit - tests for hexadecimal digit wide character

Library

libc.lib

Synopsis

  #include <wctype.h>
  int iswxdigit (wint_t wch);

Return values

The functions return zero if the character tests false and return non-zero if the character tests true.

Detailed description

The iswxdigit() function tests whether ’wch’ is a wide-character belongs to the set of characters that are used to represent hexadecimal digits.

For example: The characters that can be used to represent hexadecimal values: are - 0,1,2,3,4,5,6,7,8,9 and a,b,c,d,e,f and A,B,C,D,E,F.

Generally, the characters that can be classified as digits are used for the representing hexadecimal values along with one or more sets of continuous characters of other categories that are used to represent the hexadecimal values other than the digits(base 10).

The result of this function is undefined unless the argument is WEOF or a valid wchar_t value.

The functionality of this API is independent of the program’s current locale and so it returns non-zero for all the characters (of various locales supported) that belong to the class xdigit(see defns for definition), irrespective of the locale they belong to.


Examples

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


Output

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


See also

isdigit, iswctype

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