You can use atol()
and check for the returned value. Here is a little example:
#include <stdio.h>
#include <stdlib.h>
int
main(int argc, char **argv)
{
unsigned long int steps = 0;
if (argc > 1)
{
if (atol(argv[1]) > 0)
steps = atol(argv[1]);
}
printf("%lu\n", steps);
return 0;
}