1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
/* vswscanf example */
#include <stdarg.h>
#include <wchar.h>
void GetWideMatches ( const wchar_t * str, const wchar_t * format, ... )
{
va_list args;
va_start (args, format);
vswscanf (str, format, args);
va_end (args);
}
int main ()
{
int val;
wchar_t buf[100];
GetWideMatches ( L"99 bottles of beer on the wall", L" %d %ls ", &val, buf);
wprintf (L"Product: %ls\nQuantity: %d\n", buf, val);
return 0;
}
|