Thread: how to read and write files in c++

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    4

    Unhappy how to read and write files in c++

    I have seem to forgot how to read and write files with c++, will someone post either a tut part or refresh my memory?
    Plus, does anyone know if directx has any special functions for files?

  2. #2
    Registered User biosx's Avatar
    Join Date
    Aug 2001
    Posts
    230
    Here... I stayed up all night searching the web. I went through like 3,000,000,000 sites until I finally found this tutorial. I hope it was worth my effort

    PS I hope everybody finds this funny or at least *gets it*.

  3. #3
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    What the hell? There's a tutorial right here on this site, biosx. Hahaha, you sure wasted your time.

  4. #4
    Unregistered
    Guest

    Input/Output

    Use IFStream and OFStream.

  5. #5
    Registered User xlnk's Avatar
    Join Date
    Mar 2002
    Posts
    186
    dual-catfish, did you click on the link, heh.

    great sarcasm biosx!
    the best things in life are simple.

  6. #6
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    You include fstream.h, create either an ifstream or an ofstream object (the use for each is obviously obvious), and then use ifstream.get() and ofstream.put(), etc...

  7. #7
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    Cmon xlnk, play along :)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. read / write binary files
    By Dark_Phoenix in forum C++ Programming
    Replies: 5
    Last Post: 06-21-2009, 07:56 AM
  2. FILES (read & write)
    By gavra in forum C Programming
    Replies: 24
    Last Post: 06-16-2008, 01:22 AM
  3. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  4. using threads to write & read from files
    By kishorepalle in forum C Programming
    Replies: 4
    Last Post: 10-19-2004, 05:19 PM
  5. The problem read and write in files
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 07-05-2002, 12:54 PM