討論串[問題] C++ string 與 C char* 使用strtok的問題
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓2(2推 0噓 1→)留言3則,0人參與, 最新作者tinlans ( )時間16年前 (2010/03/02 23:56), 編輯資訊
0
0
1
內容預覽:
"" 跟 NULL 可說是天差地遠的兩種東西。. 以 0 為起始位址的 string 怎麼看都是有問題的,. 就算不丟 exception 也幾乎都會 segmentation fault。. 就算是在沒有 OS 的環境下這種機率也是微乎其微,. 所以你還是乖乖寫判斷吧。. 而且你表面上看起來那叫轉
(還有498個字)

推噓1(1推 0噓 6→)留言7則,0人參與, 最新作者adxis (Acquire higher)時間16年前 (2010/03/02 21:51), 編輯資訊
0
0
0
內容預覽:
#include <sstream>. #include <string>. #include <iostream>. int main(). {. // stringstream 的用途?. std::istringstream sin("this is xxx");. std::string w
(還有66個字)

推噓0(0推 0噓 6→)留言6則,0人參與, 最新作者Aligu1009 (=.=)時間16年前 (2010/03/02 21:13), 編輯資訊
0
0
0
內容預覽:
遇到的問題: (題意請描述清楚). 1. 若用第9行代替第10行, 第14行的strtok會segmentation fault. 2. 第18行的strtok()回傳NULL時,轉型為string的動作會產生 run time error. error msg:. terminate called
(還有965個字)
首頁
上一頁
1
下一頁
尾頁