Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Preparing a lovely in string stream
- std::istringstream iss(outputString);
- // Smash output string into its smaller pieves and shove it into the vector
- std::vector<std::string> splitString{ std::istream_iterator<std::string>(iss), {} };
- // Reverse it so the parsable string is actually right
- std::reverse(splitString.begin(), splitString.end());
- // Preparing an output string stream to smoosh things back together
- std::ostringstream oss;
- // Smash that vector back together againg
- std::copy(splitString.begin(), splitString.end(), std::ostream_iterator<std::string>(oss, " "));
- // Put it back in the lovely output string
- outputString = oss.str();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement