#include <iostream> #include <string> #include <sstream> using namespace std ; void i2s(int x, string &basic_string) { stringstream ss; ss << x; ss >> basic_string; } void s2i(string &basic_string , int &x ) { stringstream ss; ss << basic_string; ss >> x; } void c2s(char c , string & s){ stringstream stream; stream << c; s = stream.str(); } int main(){ string str = "123"; int c ; s2i(str , c); cout << c ; }