Thread: Help! About text stream and binary stream

  1. #1
    C/C++Newbie Antigloss's Avatar
    Join Date
    May 2005
    Posts
    216

    Help! About text stream and binary stream

    What are the differences between text stream and binary stream???
    What are the benifits for using binary stream?
    The use of binary stream is better than text stream in what conditions?
    Last edited by Antigloss; 09-01-2005 at 08:00 AM.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > What are the differences between text stream and binary stream?
    text is usually printable, and delimited with '\n' characters. This makes it handy for reading using say fgets()

    > What are the benifits for using binary stream?
    You can use fseek() to locate specific records.

    > The use of binary stream is better than text stream in what conditions?
    Depends on what you're doing (see above answers)
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Buffering??
    By Brain Cell in forum C Programming
    Replies: 15
    Last Post: 09-21-2004, 06:57 AM
  2. displaying binary output
    By clancyPC in forum C Programming
    Replies: 1
    Last Post: 10-14-2003, 07:32 AM
  3. Replies: 11
    Last Post: 03-22-2003, 01:50 PM
  4. ascii v. binary
    By ygfperson in forum C++ Programming
    Replies: 2
    Last Post: 04-26-2002, 04:00 PM
  5. Replies: 4
    Last Post: 10-16-2001, 02:00 PM