This question already has an answer here:
- No matching function - ifstream open() 1 answer
I'm trying to make a program that asks for the file that they user would like to read from, and when I try to myfile.open(fileName)
I get the error: "no matching function for call to std::basic_ifstream<char, std::char_traits<char> >::open(std::string&)'
" at that line.
string filename;
cout<<"Enter name of file: ";
cin>>filename;
ifstream myFile;
myFile.open(filename); //where the error occurs.
myFile.close();