Using atoi: convert string to int
#include <iostream> #include <stdlib.h> using namespace std; int main() { int i = atoi( "2593" ); cout << "The string \"2593\" converted to int is " << i << "\nThe converted value minus 593 is " << i - 593 << endl; return 0; }