how to read and write files in c++

This is a discussion on how to read and write files in c++ within the C++ Programming forums, part of the General Programming Boards category; I have seem to forgot how to read and write files with c++, will someone post either a tut part ...

  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
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    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, 01: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21