您需要#include< sstream>,< string>和< vector for this 方法。 - Marcus Kwok 用''net''替换''invalid''回复 If you are splitting the words by whitespace, you could create astd::istringstream and push them into a std::vector<std::string>. Something like: (untested and uncompiled) std::istringstream line(mostrecentline);std::vector<std::stringwords;std::string temp; while (line >temp) {words.push_back(temp);} You will need to #include <sstream>, <string>, and <vectorfor thismethod. --Marcus KwokReplace ''invalid'' with ''net'' to reply 这篇关于将字符串拆分为数组字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-28 04:25