Re: [問題] strtok的問題
strok應該是要用split功能吧
我有一個方法,不過是C++的,應該還不錯用,參考一下:)
#include <sstream>
#include <string>
#include <iostream>
//sMyString 為要分割的字串
std::istringstream iss(sMyString);
//分割字元
std::string sDelim(" ");
while( iss >> sDelim )
{
//把分割的字元輸出
std::cout << sDelim << std::endl;
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.73.243.147
※ 編輯: arenda 來自: 203.73.243.147 (05/14 10:50)
※ 編輯: arenda 來自: 203.73.243.147 (05/14 10:51)
推
05/14 12:10, , 1F
05/14 12:10, 1F
→
05/14 12:13, , 2F
05/14 12:13, 2F
討論串 (同標題文章)