How do you write to a Binary File, compared to an Ascii file?
How do you write to a Binary File, compared to an Ascii file?
well open the file in binary mode
Code:fopen("filename","wb");
where WB means Write mode and Binary mode... (if i am right)
using fseek.
More specifically wb means to open the file in binary mode with permission to write and place the file pointer at the beginning of the file.
What are you talking about? Fseek doesn't write anything, binary or text. You write the same way for both file types. However, the end result may vary depending on how you open it. I say may, because on unix systems, there is no difference between binary and ascii according to the man pages:Originally Posted by nonpuz
So it is possible that fseek behaves differently when you use it, depending on mode.The mode string can also include the letter ``b'' either
as a third character or as a character between the charac-
ters in any of the two-character strings described above.
This is strictly for compatibility with ANSI C3.159-1989
(``ANSI C'') and has no effect; the ``b'' is ignored.
Quzah.
Hope is the first step on the road to disappointment.