Thread: Iostream

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    7

    Unhappy Iostream

    Hi, there

    Can anyone help me with the following problem:

    How can I get my program to do the whole 'ifstream and ofstream' but instead of it writting the file to the same directory as the actual program but to a specified directory, for example make a new file in "c:\games"

    If anyone can help it would be great

    Thanx

    StaticMan

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    412
    You can specify the full pathname for a file. Just do something like this:

    ofstream outStream("c:\\games\\myfile.txt");

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    7

    Thumbs up Thanx for the help

    Thanx, it's working now. I mean, thanx ALOT!!! You saved me.

    Staticman

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Drieving from iostream
    By Thantos in forum C++ Programming
    Replies: 8
    Last Post: 06-23-2004, 04:57 PM
  2. iostream & hex?
    By dmlx90 in forum C++ Programming
    Replies: 0
    Last Post: 05-22-2002, 11:51 PM
  3. DJGPP Doesn't include IOSTREAM!!!!!!!!!!!
    By Frenchfry164 in forum Game Programming
    Replies: 12
    Last Post: 10-27-2001, 12:27 PM
  4. << in iostream
    By badman in forum C++ Programming
    Replies: 8
    Last Post: 10-18-2001, 10:19 PM
  5. Is there a C iostream?
    By Khisanth in forum C Programming
    Replies: 1
    Last Post: 09-05-2001, 12:34 AM