#include <sstream> // must
#include <iostream>
using namespace std;
int main()
{
stringstream ss;
/************ int->string ************/
int i = 12;
string str;
ss << i;
ss >> str;
cout << str << endl;
/************ string->int ************/
ss.clear(); // must
str = "130";
ss << str;
ss >> i;
cout << i << endl;
/************ double->string ********/
ss.clear(); // must
double d = 1.2345;
ss << d;
ss >> str;
cout << str << endl;
/************ string->double ********/
ss.clear(); // must
str = "5.4321";
ss << str;
ss >> d;
cout << d << endl;
/************ bool->string ***********/
ss.clear(); // must
bool b = true;
ss << b;
ss >> str;
cout << str <<endl;
/************ string->bool ***********/
ss.clear(); // must
str = "0";
ss << str;
ss >> b;
b ? cout << "true" : cout << "false";
return 0;
}