看板 EE_DSnP 關於我們 聯絡資訊
※ 引述《bnsblue (想當你的天空)》之銘言: : 在使用modCalc.ref的時候 : 就是在結束的時候會詢問一個是否確定的問題 : default是[No] : 可是在這時候如果直接按enter會有如下的錯誤 : terminate called after throwing an instance of 'std::out_of_range' : what(): basic_string::substr : Aborted : 請問這要怎麼辦呢? [Note: It is OK if you don't update this bug fix. We will not test this part] Bug fix (cmdCommon.cpp): ======================= [OLD] 80 size_t s = ss.find_first_not_of(' ', 0); 81 ss = ss.substr(s); 82 if (myStrNCmp("Yes", ss, 1) == 0) 83 return CMD_EXEC_QUIT; // ready to quit 84 return CMD_EXEC_DONE; // not yet to quit [NEW] 80 size_t s = ss.find_first_not_of(' ', 0); 81 if (s != string::npos) { 82 ss = ss.substr(s); 83 if (myStrNCmp("Yes", ss, 1) == 0) 84 return CMD_EXEC_QUIT; // ready to quit 85 } 86 return CMD_EXEC_DONE; // not yet to quit Please: 1. Add those two GREEN lines in your cmdCommon.cpp, or download hw3.tgz again. 2. Upload new modCalc.ref -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.121.140.242