With the C standard library stdio.h, I read that to output ASCII/text data, one should use mode "w" and to output binary data, one should use "wb". But why the difference?
In either case, I'm just outputting a byte (char) array, right? And if I output a non-ASCII byte in ASCII mode, the program still outputs the correct byte.
"b"option. Text mode being different from binary mode just makes your life hell. If you need to support legacy text files with CR's, just strip the CR in your parser; if you're usingscanf, it will ignore it for you as part of whitespace skipping. – R.. GitHub STOP HELPING ICE Jun 21 '12 at 15:31