What\'s the C++ way of parsing a string (given as char *) into an int? Robust and clear error handling is a plus (instead of returning zero).
You can use Boost's lexical_cast, which wraps this in a more generic interface. lexical_cast(Source) throws bad_lexical_cast on failure.
lexical_cast(Source)
bad_lexical_cast