#include<bits/stdc++.h>
using namespace std;
int main()
{
stringstream ss;
int a = 123;
double b=456.789;
float c;
string d;
ss<<a;
ss>>c;
cout<<c<<endl;
ss.str("");
ss.clear();
ss<<b;
ss>>d;
cout<<d<<endl;
cout<<typeid(a).name()<<endl;
cout<<typeid(b).name()<<endl;
cout<<typeid(c).name()<<endl;
cout<<typeid(d).name()<<endl;
return 0;
} |