another way would be


count = sscanf(argv[1],"%d",&tabstops);
if (count != 1) {
invalid input
}


this would convert any number, not just a single digit.