1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
/* fwscanf example */
#include <stdio.h>
#include <wchar.h>
int main ()
{
wchar_t str [80];
float f;
FILE * pFile;
pFile = fopen ("myfile.txt","w+");
fwprintf (pFile, L"%f %ls", 3.1416, L"PI");
rewind (pFile);
fwscanf (pFile, L"%f", &f);
fwscanf (pFile, L"%ls", str);
fclose (pFile);
wprintf (L"I have read: %f and %ls \n",f,str);
return 0;
}
|