View Single Post
Old 10-13-2005, 02:09 PM   #2
Gnarf
Emerald Dragon
 

Join Date: February 6, 2003
Location: Norway
Age: 40
Posts: 928
I don't really have any C++ experience, but hey [img]tongue.gif[/img] (this just what I gather from some examples on some site, so might be terribly wrong)...

Try using "getline (cin, filename);"

To open a file with that name for writing: ofstream outfile (filename);

Write to file with: outfile ,, (something);

Close file with: outfile.close();

outfile can be named something else, obviously. Think you should be including < fstream > for ofstream to be working. And, ifstream is used for reading from files

[ 10-13-2005, 02:10 PM: Message edited by: Gnarf ]
__________________
I want a hippo.
Gnarf is offline   Reply With Quote