the code
creates a file in the same directory of the program, what can i do to exchange the directory? ty in advanced.Code:ofstream a_file("Data")
the code
creates a file in the same directory of the program, what can i do to exchange the directory? ty in advanced.Code:ofstream a_file("Data")
add the full path to where you want the file, such as "c:\mydir\Data" for MS-Windows, or "/mydir/Data" for *nix.
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!Originally Posted by Enahs