Or my favorite, boost::lexical_cast:
Code:
int x = boost::lexical_cast<int>("12345678");
That is, if you are allowed to use these shortcuts, and it is not an assignment.
It's part of the Boost library (boost.org).