hi,
friend of mine did coding for checks because i had to submit project yesterday but today when i was check how he did it i am unable to understand
also what is isdigit
here is the code:
Code:
int checkNumber(char [], int);
int checkLetters(char []);
----------------------
int checkNumber(char number[], int allowDots) {
for (int i = 0; i < strlen(number); i++) {
if (!allowDots)
if (!isdigit(number[i]))
return 0;
}
return 1;
}
int checkLetters(char string[]) {
for (int i = 0; i < strlen(string); i++) {
if (isdigit(string[i]))
return 0;
}
return 1;
}