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:
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 backCode: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; } } }
whats wrong with what i wrote above.
please can someone help
Thanks



LinkBack URL
About LinkBacks


