So basically my problem is that i have the argv array from the stdin an if i type ./a.out 1
i want to convert this 1 into an int or long, the problem is that if i do a cast into a long it converts the number into a random number and if i cast it to an int i get a warning and an error problably.
Program:
#include <stdio.h>
int main(int argc, char* argv[]) {
int j = (int) argv[1];
printf("* j = %d\n",j);
return 0;
}