Thread: fstream binary files

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    4

    fstream binary files

    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

  2. #2
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Processing binary or plaintext files
    By Jags in forum C Programming
    Replies: 12
    Last Post: 08-04-2006, 02:35 PM
  2. Fseek and binary files
    By kambrian in forum C Programming
    Replies: 2
    Last Post: 02-06-2006, 04:20 PM
  3. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 11:46 AM
  4. Binary files
    By docetes in forum C Programming
    Replies: 2
    Last Post: 04-21-2005, 01:42 PM
  5. deleting files not in fstream?
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 10-09-2001, 01:36 PM