A
aurgathor
Is there a better way to check if a char* contains
characters that are not decimal numbers?
TIA
// quickly scan str, return if something is outside [0..9]
count = 0;
while (str[count] != '\0') {
if ((str[count] < '0') || (str[count] > '9')) {
return INVALID_CHAR;
}
count++;
}
characters that are not decimal numbers?
TIA
// quickly scan str, return if something is outside [0..9]
count = 0;
while (str[count] != '\0') {
if ((str[count] < '0') || (str[count] > '9')) {
return INVALID_CHAR;
}
count++;
}