-2
几个答案(如splitting int from a string)提议C++字符串分割到数组
#include <sstream>
Unforunately,没有编制,我(错误 “sstream:没有这样的文件或目录”)。 我发现我可以使用
#include <strstream>
改为。好吧,现在,与
std::string s = "100 123 42";
std::istringstream is(s);
我得到了“未声明的变量istringstream”(首次在这里使用)“。 好吧,尝试:
std::istrstream is(s);
几乎可以。错误:“没有匹配函数调用`istrstream :: istrstream(string &)'”。
std::istrstream is();
所以我觉得我附近某处:)缺少了什么: 但至少它编译?
'的#include',''不赞成或者是过时的。无论如何''是你想要的。 –
john
您必须使用'#include'而不是'#include ''? –
[什么不能编译?](http://ideone.com/ERBFqX) – P0W