#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
stringstream ss;
// string to int
string str="12";
ss<<str;
int a;
ss>>a;
cout<<a<<"\n";
//int to string
ss<<a;
string str1;
ss>>str1;
cout<<str1<<" ";
return 0;
}
No comments:
Post a Comment