#include <stdio.h>
#include <wchar.h>
int main() {
int n = 435;
double pi = 3.14;
wchar_t wch = 'A';
wchar_t wstr[16] = L"abc\n";
FILE* fp = fopen("d:\\data.txt", "w");
int total_chars_written_to_file = fwprintf_s(fp, L"%d %lf %c %s", n, pi, wch, wstr);
fclose(fp);
wprintf(L"total chars written = %d\n", total_chars_written_to_file);
return 0;
}
// data.txt
//
// 435 3.140000 A abc
//
/*
run:
total chars written = 19
*/