1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
/* wcstok example */
#include <wchar.h>
int main ()
{
wchar_t wcs[] = L"- This, a sample string.";
wchar_t * pwc;
wchar_t * pt;
wprintf (L"Splitting wide string \"%ls\" into tokens:\n",wcs);
pwc = wcstok (wcs, L" ,.-", &pt);
while (pwc != NULL)
{
wprintf (L"%ls\n",pwc);
pwc = wcstok (NULL, L" ,.-", &pt);
}
return 0;
}
|