This is a common newbie error. The problem lies here:
The isdigit() function and all of it's issomething() functions take a single char as input. But, argv is a string, not a single char. This code is taking a string and shoving it down isdigit's throat, so it chokes and coughs up a seg fault.
The code needs to check each char in argv...