作者ColaNut (可樂果)
看板EE_DSnP
標題[問題] hw2.test1
時間Tue Oct 22 11:42:26 2013
敢問,我打了./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)
1F:推 ric2k1:首先,hw2.test1 不是這樣用的,它是要給你照著打,然後 10/22 14:33
2F:→ ric2k1:看看你程式的 response 跟上面寫得是不是一樣。 10/22 14:33
3F:→ ric2k1:當然,你把 hw2.test1 當作是 dofile 直接餵給 cmdReader跑 10/22 14:34
4F:→ ric2k1:理論上也是不會有問題,所以你看到 Aborted 其實就是你的 10/22 14:35
5F:→ ric2k1:程式有問題,請開 debugger 看一下就會有答案了。 10/22 14:35
6F:→ ric2k1:至於這個 error message 的意義,可以參考 lecture note#6 10/22 14:37
7F:→ ric2k1:p65 關於 limited throw 的部分。(明天會教) 10/22 14:39
8F:→ ColaNut:我發現是我忘記判定null string~XD 10/22 19:35
9F:→ ColaNut:謝謝老師~!! 10/22 19:35