Reputation: 318
When I use fprintf:
fprintf(somefile,"%c",'\n');
It prints '\r\n' to the file. How do I just print '\n'?
I'm writing to a binary file. The code above is just for debugging.
Upvotes: 5
Views: 767
Reputation: 7363
When you open the file you have to open it in binary mode and not in text mode. This is done like this:
fopen("filename", "wb");
Upvotes: 6