SyntaxFix
Write A Post
Hire A Developer
Questions
You can use strtol for that:
strtol
long x; if (argc < 2) /* handle error */ x = strtol(argv[1], NULL, 10);
Alternatively, if you're using C99 or better you could explore strtoimax.
strtoimax