fork download
  1. #include <iostream>
  2. #include <sstream>
  3.  
  4. void printStringStream(std::ostream& ss)
  5. {
  6. std::cout << ss.rdbuf();
  7. }
  8.  
  9. int main() {
  10. int intVar = 3;
  11. float floatvar= 3.14159;
  12. std::stringstream var;
  13. printStringStream( var << "Text" << intVar << "More text"<<floatvar);
  14. }
Success #stdin #stdout 0.01s 2860KB
stdin
Standard input is empty
stdout
Text3More text3.14159