So I have stored a string from the user input, and I want to check whether it is an integer. So it calls my is_digit function, sending it the inputted sting:
Code:
int is_digit(char digit)
{
while(1)
{
if (isdigit(digit))
{
return (digit);
break;
}
else
{
printf("Please reenter value, only numbers please\n");
scanf("%s", digit);
printf("%s", digit);
continue;
}
}
}
so it is meant to check whether digit is a number, if it is send it back else ask for a number, check that is a digit, and if se, send it back
whats wrong with what i wrote above.
please can someone help
Thanks