// Both functions work identically though you'll need to use "#include <string>" atoi( str.c_str() ); stoi( str );