C++ Wiki
std::stringstream
の使い方
サンプルコード
#include <iostream>
#include <sstream>
int main()
{
std::string string = "abc defg hi j";
std::stringstream stream(string);
while(!stream.eof()){
std::string s;
stream >> s;
std::cout << s << std::endl;;
}
return 0;
}
実行結果
abc
defg
hi
j