fork download
  1. #include <iostream>
  2. #include <sstream>
  3. using namespace std;
  4.  
  5. void appendStream( stringstream &currStream, string input ){
  6. currStream << input;
  7. }
  8.  
  9. int main() {
  10. stringstream myStream;
  11.  
  12. int number = 5;
  13. appendStream( myStream, to_string(number) );
  14.  
  15. bool myBool = false;
  16. appendStream( myStream, to_string(myBool) );
  17.  
  18. cout << myStream.str() << endl;
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
50