i have a piece of code like this:
int main (int argc, char *argv[]) { printf(\"%d\\t\",(int)argv[1]); printf(\"%s\\t\",(int)argv[1]); }
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