http://www.perfect-is-shit.com/stackoverflow-split-string.html
摘其中一种方法:
#include <vector>
#include <string>
#include <sstream>
using namespace std;
int main()
{
string str("Split me by whitespaces");
string buf; // Have a buffer string
stringstream ss(str); // Insert the string into a stream
vector<string> tokens; // Create vector to hold our words
while (ss >> buf)
tokens.push_back(buf);
}
怎么把字符串按空格切分
把字符串转成数字