I have:
string filename: ifstream file(filename);
Compilers complain about the lack of correspondence between the ifstream file and the string. Do I need to convert a file name to something?
Here's the error:
error: no matching function for call to 'std::basic_ifstream<char, std::char_traits<char> >::basic_ifstream(std::string&)' /usr/include/c++/4.4/fstream:454: note: candidates are: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::_Ios_Openmode) [with _CharT = char, _Traits = std::char_traits<char>]
c ++ ifstream
Mark Jun 12 '11 at 18:08 2011-06-12 18:08
source share