-
opening files
hey guys, thanks for the quick response on the other question. i got that to work but i'm still having one other problem. i want to write a program so that you can store a file name in a string variable and then use that variable to open the file. heres an example
string name;
name = "washington.txt";
in_stream.open(name);
i know its storing the string rigth but for some reason i cant get the file to open using that variable, i get a really long error about conversions. any ideas?
-
Code:
char *name = "washington.txt";
in_stream.open(name);
-
Another solution is c_str().
theFile.open(theString.c_str());
Kuphryn