iswdigit - C wctype.h

C examples for wctype.h:iswdigit

Type

function

From


<cwctype>
<wctype.h>

Description

Check if wide character is decimal digit

Prototype

int iswdigit (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 decimal digit. Zero (i.e., false) otherwise.

Demo Code


#include <stdio.h>
#include <wchar.h>
#include <wctype.h>
int main ()/*from w  ww .  java2s  .  c  o  m*/
{
  wchar_t str[] = L"this is a test 2000";
  long int year;
  if (iswdigit(str[0]))
  {
    
    year = wcstol (str,NULL,10);
    
    wprintf (L"%ld %ld.\n",year,year+1);
  }
  return 0;
}

Related Tutorials