1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
/* vfwscanf example */
#include <stdio.h>
#include <stdarg.h>
#include <wchar.h>
void ReadWideStuff (FILE * stream, const wchar_t * format, ...)
{
va_list args;
va_start (args, format);
vfwscanf (stream, format, args);
va_end (args);
}
int main ()
{
FILE * pFile;
int val;
wchar_t str[100];
pFile = fopen ("myfile.txt","r");
if (pFile!=NULL) {
ReadWideStuff ( pFile, L" %ls %d ", str, &val );
wprintf (L"I have read %ls and %d", str, val);
fclose (pFile);
}
return 0;
}
|