On Windows this
#include
int main() {
putc(\'A\',stdout);
putc(\'\\r\',stdout);
putc(\'\\n\',stdout);
}
outp
The MSVC solution is:
#include
#include
...
_setmode(1,_O_BINARY)
Other runtimes may provide the C99 solution or an alternate way. EDIT: I believe setmode([file number],O_BINARY)
originated on Borland Turbo C, and other compilers for MS-DOS and Windows imitated it. The _ prefix is done to keep the namespace clean, and may not be present on some compilers.