My program calculates the first n numbers of the fibonacci series. For error checking, I've prevented the program from trying to calculate a negative number, but I'm having trouble with character inputs.
Here is my code to detect character inputs:
I read online that isdigit's return value for a true condition is a non-zero number. When my program reaches this point, it crashes. When I remove these lines of code from my program it runs perfectly.Code:if(isdigit(argv[2]) !=0){
number = atoi(argv[2]);
printf("%d Fibonacci numbers\n",number);
}
else{
printf("You must input a positive integer);
}