What i wanna do is that take the input from the user and pass it to a function and use that input as the file name.The myfile is a global variable of type fstream that i have used in my program.The error statement is:
[Error] no matching function for call to
std::basic_fstream<char>::open(std::string&, const openmode&)
void displayRecord(string filename) {
string s;
myfile.open(filename, ios::in); // error here
while (!myfile.eof()) {
myfile >> s;
cout << s << endl;
}
myfile.close();
}