C examples for wctype.h:iswdigit
function
<cwctype> <wctype.h>
Check if wide character is decimal digit
int iswdigit (wint_t c);
Parameter | Description |
---|---|
c | Wide character to be checked |
A non zero value (i.e., true) if c is a decimal digit. Zero (i.e., false) otherwise.
#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; }