can someone plz explain binary vs text files with fstream...
and also how to use/create/work with binary files
thanks to anyone who post some info
can someone plz explain binary vs text files with fstream...
and also how to use/create/work with binary files
thanks to anyone who post some info
Every file is stored in binary; the difference from writing to a "binary" file and one which is encoded in ASCII is writing raw data vs. encoded data.
There are plenty of resources around the web on working with binary files... try searching the board, or even google.
http://members.evolt.org/burhankhali...ves/000045.php
When you write to a binary file, you're writing raw values. If you send a 0 to the stream, 0 is written to the file. However, if the file is open in textmode, streaming a 0 will have the ASCII character code for '0' written.