error: no matching function for call to ‘std::basic_ifstream::open(std::__cxx11::string&, const openmode&)’ 最近感觉C++忘的太多,老喜欢在C++里面使用C风格的代码,现在连fstream都不会写了 ifstream fp; string path = "laji.txt"; fp.open(path,ios::in); ........ 发现,这样写会报题目的这个错误,不能传字符串,应该传字符数组。果然,忙完最近应该写一个读取文件的笔记,立一个flag。