I'm parsing the command line and part of the specs is that after a '-s', there should be a number specifying the start byte (doesn't matter what it's for...only that I'm supposed to get a # afterwards).
so I got this:
I tried to convert the input to an int but that's no good because it converts and char in to an int which is then saved as my start bit. So the letter 'd' would be whatever the ascii code is (I think) as opposed to printing the error message and qutting.
So I guess isdigit isn't the best function, anyone have ideas about this??
so I got this:
int main(int argc, char *argv[])
.
.
for(i = 1; i < argc; i++)
.
.
if(strcmp(argv, "-s") == 0)
{
i++;
if(isdigit( (int) argv) ) <-------- PROBLEM
start = (int)argv;
else
{
printf("\n\nIllegal arguments, exiting now\n\n");
exit(1);
}
}
I tried to convert the input to an int but that's no good because it converts and char in to an int which is then saved as my start bit. So the letter 'd' would be whatever the ascii code is (I think) as opposed to printing the error message and qutting.
So I guess isdigit isn't the best function, anyone have ideas about this??
