Mega Code Archive

 
Categories / C++ / Data Type
 

Using atol

#include <iostream> #include <stdlib.h> using namespace std; int main() {    long l = atol( "1000000" );    cout << "The string \"1000000\" converted to long is " << l         << "\nThe converted value divided by 2 is " << l / 2          << endl;    return 0; }