C examples for wctype.h:iswxdigit
function
<cwctype> <wctype.h>
Check if wide character is hexadecimal digit
int iswxdigit (wint_t c);
Parameter | Description |
---|---|
c | Wide character to be checked |
A non zero value (i.e., true) if c is a hexadecimal digit. Zero (i.e., false) otherwise.
#include <stdio.h> #include <wchar.h> #include <wctype.h> int main ()// w w w. j a v a 2 s.co m { wchar_t str[] = L"ffffdead"; long int number; if (iswxdigit(str[0])) { number = wcstol (str,NULL,16); wprintf (L"The hexadecimal number %lx is %ld.\n",number,number); } return 0; }