Skip to content

Instantly share code, notes, and snippets.

@krdln
Last active December 26, 2015 23:49
Show Gist options
  • Save krdln/7233665 to your computer and use it in GitHub Desktop.
Save krdln/7233665 to your computer and use it in GitHub Desktop.
stringstream
#include <sstream>
#include <iostream>
#include <string>
using namespace std;
string ss2s(ostream const& os) {
return static_cast<stringstream const&>(os).str();
}
int main() {
cout << ss2s(stringstream() << "Liczba " << 42);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment