Thread: fstream

  1. #1
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246

    Question fstream

    Can we use fstream instead of ifstream and ofstream? If so, why that i&o exist?

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    fstream can do both input and output, while ifstream is input only and ofstream is output only.

  3. #3
    Registered User
    Join Date
    Jan 2006
    Posts
    19
    Quote Originally Posted by Ancient Dragon
    fstream can do both input and output, while ifstream is input only and ofstream is output only.

    I think what he is trying to say is why do they have ifstream and ofstream when we can use fstream.

    My guess would be that if you have a program that does one or maybe the other it wouldn't be necessary to add a bigger library.

  4. #4
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    Quote Originally Posted by Starr
    I think what he is trying to say is why do they have ifstream and ofstream when we can use fstream.
    Yes this is what I mean.

    And how much big that lib is you think?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems with fstream, one variabile for write and read
    By Smjert in forum C++ Programming
    Replies: 3
    Last Post: 02-03-2009, 10:19 PM
  2. Fstream. I/O
    By kevinawad in forum C++ Programming
    Replies: 2
    Last Post: 07-07-2008, 09:19 AM
  3. ARGH! fstream errors
    By OttoDestruct in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2004, 10:37 PM
  4. Are fstream and ofstream incompatible?
    By johnnyd in forum C++ Programming
    Replies: 5
    Last Post: 03-19-2003, 12:21 PM
  5. Problems with fstreams.
    By mosdef in forum C++ Programming
    Replies: 7
    Last Post: 06-19-2002, 03:36 PM