Skip to content

Instantly share code, notes, and snippets.

@Xjs
Created July 7, 2012 13:27
Show Gist options
  • Save Xjs/3066483 to your computer and use it in GitHub Desktop.
Save Xjs/3066483 to your computer and use it in GitHub Desktop.
integerNumber & digit
size_t Parser::integerNumber(size_t index) {
char *c_term = term.c_str();
if (c_term[index] == '+' || c_term[index] == '-')
index++;
while (digit(index))
index++;
return index;
}
int Parser::digit(size_t index) {
char *c_term = term.c_str();
return isdigit(c_term[index]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment