Using atoi : convert from string « Data Types « C++ Tutorial






#include <iostream>
using std::cout;
using std::endl;

#include <cstdlib>
using std::atoi;

int main()
{
   int i = atoi( "2593" );

   cout << i - 593 << endl;
   return 0;
}
2000








2.29.convert from string
2.29.1.Using atof.
2.29.2.Using atoi
2.29.3.Using atol
2.29.4.Using strtod
2.29.5.Using strtol
2.29.6.Using strtoul