P
pentiumPunk
string fileName;
cout<<"Enter filename of datafile you wish to open \n";
cin>>fileName;
ifstream fin;
fin.open(fileName, ifstream::ios);
if(!fin)
{
cerr<<"blah blah blah";
exit(1);
}
i get this error message in VC++ .....Error C2664...on the
fin.open(fileName, ifstream::ios); line...cannot convert parameter 1 from
std::string to const char *
i cannot put a certain filename down such as fin.open("textfile.txt"), i
need the user to enter its name, for it will change.
Thanks alot in ahead!
cout<<"Enter filename of datafile you wish to open \n";
cin>>fileName;
ifstream fin;
fin.open(fileName, ifstream::ios);
if(!fin)
{
cerr<<"blah blah blah";
exit(1);
}
i get this error message in VC++ .....Error C2664...on the
fin.open(fileName, ifstream::ios); line...cannot convert parameter 1 from
std::string to const char *
i cannot put a certain filename down such as fin.open("textfile.txt"), i
need the user to enter its name, for it will change.
Thanks alot in ahead!