[Solved] Understanding stringstream [closed]

There’s a constructor for std::stringstream that takes a std::string as a parameter and initializes the stream with that value. #include <iostream> #include <sstream> #include <string> int main() { std::stringstream ss(“foo bar”); std::string str1, str2; ss >> str1 >> str2; std::cout << “str1: ” << str1 << std::endl; std::cout << “str2: ” << str2 << std::endl; … Read more