PDA

View Full Version : File creation



Unregistered
04-17-2002, 07:33 PM
Now, i know how to create files in C++... but how do i create a file with the name the user wants?

eg. ifstream f1 ("Userschoice");


Note: i'm using Borland Turbo C++ 3.0 DOS

Quantrizi
04-17-2002, 08:03 PM
This should work:


ifstream(gamedata)
istream("gamedata",ios::in)
if (gamedata)
{
load >> stuff;
}

That should work.........

ihsir
04-18-2002, 08:36 PM
Quantrizi: i dont think that is what he wants :)

this should do what you want..



ifstream fin;
char fname[12];
cin.getline(fname,12,'\n');
fin.open(fname)
--
--