No matching function - ifstream open()

断了今生、忘了曾经 提交于 2019-11-25 22:49:21

Change to:

file.open(name.c_str());

or just use the constructor as there is no reason to separate construction and open:

std::ifstream file(name.c_str());

Support for std::string argument was added in c++11.

As loadNumbersFromFile() does not modify its argument pass by std::string const& to document that fact and avoid unnecessary copy.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!