Thread: help

  1. #1
    Registered User
    Join Date
    Oct 2005
    Location
    Brasil
    Posts
    220

    help

    the code
    Code:
    ofstream a_file("Data")
    creates a file in the same directory of the program, what can i do to exchange the directory? ty in advanced.

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    add the full path to where you want the file, such as "c:\mydir\Data" for MS-Windows, or "/mydir/Data" for *nix.

  3. #3
    ^ Read Backwards^
    Join Date
    Sep 2005
    Location
    Earth
    Posts
    282
    But remember \ is used by c++, so to use a slash you have to 'escape' it first.
    For for one \, you have to put \\.

  4. #4
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    Quote Originally Posted by Enahs
    But remember \ is used by c++, so to use a slash you have to 'escape' it first.
    For for one \, you have to put \\.
    Oops!

Popular pages Recent additions subscribe to a feed