#include<sstream>
#include<string>
#include<iostream>
using namespace std;
stringstream ss;
string some("11123");
int tmp;
ss << some;
ss >> tmp;
ss.clear();
or
tmp = std::stoi(some);
------------------------reference------------------------------------------
http://www.cplusplus.com/reference/string/stoi/