This just happened to me while testing a part of a bigger program that I isolated. The original function would remove non ascii characters from a string in a special manner that I needed, the thing is this program
#include <stdio.h>
#include <wchar.h>
int main(int argc, char *argv[])
{
fwprintf(stdout, L"-- Example\n");
fprintf(stdout, "-- Example\n");
return 0;
}
would not print the second -- Example
on my linux (Fedora 22) system. Although using fwprintf()
again or fprintf(stderr, "-- Example\n");
would work.
- Is this the expected behavior? And why?