<分区>
我不确定如何修复错误(如下)。有人可以帮助我吗?
顺便说一句:它在 VS2012 上运行良好,但是当我在 linux 终端上运行时它给了我这个错误
错误:
Librarian.cpp:20: error: no matching function for call to ‘std::basic_ifstream >::basic_ifstream(s td::string&, const std::_Ios_Openmode&)’
图书管理员.cpp:
bool Librarian::addBooks(string file)
{
ifstream infile(file);
if (!infile)
{
cerr << "File could not be opened." << endl;
return false;
}
for (;;) {
char s[MAX];
infile.getline(s, MAX);
if (infile.eof()) break;
cout << s << endl;
}
return true;
}