討論串[問題] strtok的問題
共 7 篇文章
首頁
上一頁
1
2
下一頁
尾頁

推噓2(2推 0噓 6→)留言8則,0人參與, 最新作者elongoria (longoria)時間14年前 (2010/11/28 14:00), 編輯資訊
0
0
0
內容預覽:
遇到的問題: (題意請描述清楚). strtok讀取結果未如預期. 希望得到的正確結果:. In the class, store:1,05:11:11,06:50:12. In the class, name: 1. In the class, starttime: 05:11:11. In th
(還有696個字)

推噓0(0推 0噓 2→)留言2則,0人參與, 最新作者arenda ( )時間16年前 (2009/05/14 04:53), 編輯資訊
0
0
0
內容預覽:
感謝L大指教,不過我用下列這個split函式 "偶而"會出現std::bad::alloc()錯誤. ,有人知道為什麼嗎? 謝謝. std::vector<string> Split(const std::string &src, std::string. delimit, std::string
(還有584個字)

推噓1(1推 0噓 1→)留言2則,0人參與, 最新作者arenda ( )時間16年前 (2009/05/14 02:49), 編輯資訊
0
0
0
內容預覽:
strok應該是要用split功能吧. 我有一個方法,不過是C++的,應該還不錯用,參考一下:). #include <sstream>. #include <string>. #include <iostream>. //sMyString 為要分割的字串. std::istringstream
(還有149個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者DDark (心)時間16年前 (2009/05/13 02:59), 編輯資訊
0
0
0
內容預覽:
分割後 tmp = "T";. 然後你說的把T變為\0 應該是strtok裡有一個buffer去存. 分割後的字串"his is a string";. 如果你再繼續用strtok(NULL," ");會得到tmp = "his";. 分割後的字串變為"is a string". --. 發信站

推噓1(1推 0噓 3→)留言4則,0人參與, 最新作者LiloHuang (相見不如懷念)時間16年前 (2009/05/06 02:27), 編輯資訊
0
0
0
內容預覽:
這邊應該改成 const char *buf = "AA \"123 456\"";. 右邊那串是 read-only 的 text section. 你如果要可以修改應該寫 char buf[] = "AA \"123 456\"";. #include <stdio.h>. #include <
(還有83個字)
首頁
上一頁
1
2
下一頁
尾頁