#include <iostream>
#include <cstdio> // atoi
#include <string>
#include <sstream> // stringstream
using namespace std;
int main(){
// string2int using function s.str() and atoi() in <stdio.h>
string s = "123";
int a = atoi(s.c_str());
cout << "string2int: " << a << endl;
/*
string.c_str(): string -> const char*
atoi(): const char* -> int
atof(): char* -> float
atol(): char* -> long int
*/
// int2string using stringstream in <sstream>
a = 111;
stringstream ss;
ss << a;
s = ss.str();
cout << "int2string: " << s << endl;
}