看板 EE_DSnP 關於我們 聯絡資訊
敢問,我打了./cmdReader -f hw2.test1 卻出現 ... ... ... terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::substr cmd> Aborted (core dumped) 這是什麼意思啊? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.25.108 ※ 編輯: ColaNut 來自: 140.112.25.108 (10/22 11:43)
ric2k1:首先,hw2.test1 不是這樣用的,它是要給你照著打,然後 10/22 14:33
ric2k1:看看你程式的 response 跟上面寫得是不是一樣。 10/22 14:33
ric2k1:當然,你把 hw2.test1 當作是 dofile 直接餵給 cmdReader跑 10/22 14:34
ric2k1:理論上也是不會有問題,所以你看到 Aborted 其實就是你的 10/22 14:35
ric2k1:程式有問題,請開 debugger 看一下就會有答案了。 10/22 14:35
ric2k1:至於這個 error message 的意義,可以參考 lecture note#6 10/22 14:37
ric2k1:p65 關於 limited throw 的部分。(明天會教) 10/22 14:39
ColaNut:我發現是我忘記判定null string~XD 10/22 19:35
ColaNut:謝謝老師~!! 10/22 19:35