0

Hello,

when I give fprintf the character 0x0A, then it prints out 0x0D and 0x0A (which is \n in Windows). How can I print only 0x0A? I need to print a picture into a file containing 16-bit pixels, (and some bytes contain the value of 0x0A,) so it is very bad if I cannot do it because of this bug.

fprintf(file, "%c", 10);

Greetings,
Dani

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by ddanii
0

Open the file in binary mode and use binary output functions, not fprintf()

Thanks for the advice, this helped.

Greetings: Dani

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.