iswxdigit - C wctype.h

C examples for wctype.h:iswxdigit

type

function

From


<cwctype>
<wctype.h>

Description

Check if wide character is hexadecimal digit

Prototype

int iswxdigit (wint_t c);

Parameters

Parameter Description
c Wide character to be checked

Return Value

A non zero value (i.e., true) if c is a hexadecimal digit. Zero (i.e., false) otherwise.

Demo Code


#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;
}

Related Tutorials