也是可爱ne 2021-09-01 00:12 采纳率: 100%
浏览 122
已结题

用VS不报错,但是用Devc++一直报错

file.open(filename, ifstream::in | ifstream::app);

85 51 C:\Users\86186\Documents\tencent files\2120733640\filerecv\mobilefile\stumangement(1).cpp [Error] no matching function for call to 'std::basic_fstream::open(std::string&, std::_Ios_Openmode)'

file.open(filename, ifstream::out );

100 37 C:\Users\86186\Documents\tencent files\2120733640\filerecv\mobilefile\stumangement(1).cpp [Error] no matching function for call to 'std::basic_fstream::open(std::string&, const openmode&)'

  • 写回答

1条回答 默认 最新

  • 沉迷学习w 2021-09-01 07:20
    关注

    filename.c_str()

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 9月9日
  • 已采纳回答 9月1日
  • 创建了问题 9月1日