1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
/* iswdigit example */
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>
int main ()
{
wchar_t str[] = L"1776ad";
long int year;
if (iswdigit(str[0]))
{
year = wcstol (str,NULL,10);
wprintf (L"The year that followed %ld was %ld.\n",year,year+1);
}
return 0;
}
|