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 could use this defined method.
#define toInt(x) {atoi(x.c_str())};
And if you were to convert from String to an Integer, you would just do the following.
int main() { string test = "46", test2 = "56"; int a = toInt(test); int b = toInt(test2); cout<
The output would be 102.