Hello guys
I am trying this simple program:
Code:
#include <iostream>
#include <math.h>
#include <ctime>
int main(int argc, char *argv[])
{
cout << endl << argv[1] << endl
<< atol(argv[1]) << endl
<< strtoul(argv[1],NULL,36) << endl <<
(unsigned long long) argv[1] << endl <<
(long long) argv[1] << endl;
return 0;
}
I want to be able to transfer the argv[1] (which is a long long type) into a variable, but I am not able to convert it to a number.
Here is the output when I test the program:
./program 1124555552555562554
Code:
1124555552555562554
541357626
4294967295
18446744073705356114
-4195502
How can I convert argv[1] into a long long type so I can use it like:
long long number = argv[1];
Thanks for any hints,