Printing a line feed char
Rikus last edited by
This is in C...
I have the code: fprintf(fp, "%c", 10);
which prints the ascii 10 (line feed) into a file. But then when I view the file contents in Hex, it gives me 0D 0A... How do I just output the 0A and not the 0D?
Goplat last edited by
You have to open the file in binary mode. i.e. change fopen("file", "w") into fopen("file", "wb")
danielpitts last edited by
Use Linux or Unix.
skippy last edited by
Stupid default text mode. And of course to keep with backwards compatibility, this can never change