#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main()
{
stringstream sStream{"Hello World!"};
cout << sStream.str() << endl;
stringstream ss;
ss << "Hi There";
cout << ss.str() << endl;
string s = ss.str();
cout << s << endl;
char c = 'B';
int i = 40;
double d = 90.50;
stringstream ss2;
ss2 << c << ' ' << i << ' ' << d;
cout << ss2.str();
return 0;
}
Posted inC++