|
[06 Sep 2003|01:12am] |
ifstream inputFile;
string Name;
cout << "Which file would you like to read from? ";
getline( cin, Name );
inputFile.open( Name );
Does anyone know how to make this actually work? This is obviously part of a larger file, and yes, I included iostream, fstream and string. My compiler tells me something I don't completely understand, but the jist of it is that 'Name' isn't a valid parameter for inputFile.open(). So what -is- a valid parameter? How can I make this work?
I'm pretty sure it would work if I did char[100] Name; instead of string Name; and then passed inputFile.open( Name, 100 )... but I'd really like to use strings if it is possible. Help?
|
|