I can write information to files, but I want to be able to save the resulting file to various folders. How do I do this? An example of my code is below. Thanks in advance for any help!
-----------------------
#include <iostream.h>
#include <fstream.h>
#include <string.h>
int main()
{
string Name,
School;
ofstream a_file("Info.doc");
a_file<< "Your name is : " << Name <<endl;
a_file<< "You go to " << School <<endl;
a_file.close();
return(0);
}
-----------------------
I would like to be able to save Info.doc (or whatever my file name is) in a different folder, anything but the base folder that I ran the program from (where the file normally creates). Any help is appreciated.
Kyoto Oshiro
http://www.angelfire.com/realm2/horizon/files.html
Horizon Games