I want to output some wchar_t array filled from some windows api into a file opened with fopen:
wchar_t content[256];
SomeWindowsAPI(content, 256);
FILE *file;
file=fopen( "C:\\log","a+");
fputs(content , file); //????
However, fputs expects a const char* array. Is there some other C api to write to a file pipe that expects wide array characters?
For printing a null-terminated sequence, the wide analogue of
fputsisfputws:As an alternative, you can write the raw data in your wide string with
fwrite: