What i'm trying to do is find the amount of digits in character array.
i have a char array = numbercontents.
Code:char numbercontents[12] = {'1', '2', '3', '4', 'S'}; the above is defined in the main function.^ is defined in isDigit function.Code:int isDigit(char *numbercontents) int length = 0 int count = 0; while (numbercontents[length] != '\0' ) if (isgraph((int) *numbercontents)) count++; // seems like an integer, increment count else { length++;} // otherwise just move to the NEXT element in numbercontents.
no idea why it's not working :\
i've also tried
if (isdigit((int) *numbercontents))