亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

沒有匹配的功能 - ifstream open()

沒有匹配的功能 - ifstream open()

C++
12345678_0001 2019-12-02 08:04:54
沒有匹配的功能 - ifstream open()這是代碼中包含錯誤的部分:std::vector<int> loadNumbersFromFile(std::string name){     std::vector<int> numbers;     std::ifstream file;     file.open(name); // the error is here     if(!file) {         std::cout << "\nError\n\n";         exit(EXIT_FAILURE);     }     int current;     while(file >> current) {         numbers.push_back(current);         file.ignore(std::numeric_limits<std::streamsize>::max(), '\n');     }     return numbers;}好吧,我有點不知道發生了什么。整個事情在VS中正確編譯。但是我需要用dev cpp編譯它。我在上面的代碼中注釋了拋出錯誤的行。錯誤是:調用'std :: basic_ifstream :: open(std :: string&)沒有匹配函數調用'std :: basic_ofstream :: open(std :: string&)沒有匹配函數在代碼的不同部分,我得到的錯誤如'numeric_limits不是std的成員'或'max()尚未聲明',盡管它們存在于iostream類中,并且一切都在VS中工作。為什么我收到此錯誤?
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 481 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號