C++ ifstream error using string as opening file path.

前端 未结 3 2004
自闭症患者
自闭症患者 2020-11-30 21:50

I have:

string filename: 
ifstream file(filename);

The compilers complains about no match between ifstream file and a string. Do I need to

3条回答
  •  孤独总比滥情好
    2020-11-30 22:15

    in c++-11 it can also be an std::string. So (installing c++-11 and) changing the dialect of you project to c++-11 could also fix the problem.

提交回复
热议问题