1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
/* fwprintf example */
#include <stdio.h>
#include <wchar.h>
int main ()
{
FILE * pFile;
int n;
wchar_t name [100];
pFile = fopen ("myfile.txt","w");
for (n=0 ; n<3 ; n++)
{
fwprintf (stdout, L"please, enter a name: ");
fgetws (name, 100, stdin);
fwprintf (pFile, L"Name %d: %s",n,name);
}
fclose (pFile);
return 0;
}
|