Originariamente inviato da gandalf45
2°)
string myString="123";
int myInt;
try { myInt=Integer.parseInt(myString); }
catch(NumberFormatException e) { }
Ehm..questo è java

Un modo per ottenere ciò che vuoi è creare un stringstream, scivere il numero e poi ottenere la stringa:

ostringstream s;
s << 5;
string num = s.str();

cosi num conterrà la stringa "5" (devi includere #include <sstream>)