#include<iostream>
#include<string>
#include<sstream>
using namespace std;
int main()
{
stringstream ss;
string s="456";
int x;
//string to int(or double etc...)
ss<<s;
ss>>x;
cout<<x;
//string to int using stoi
x = stoi(s);
//clean up stringstream
ss.str("");
ss.clear();
//int(or double etc...) to string
x=100;
s=to_string(x);
cout<<s;
return 0;
}

Hubert's Coding Notes
Useful notes for CS people