Или вы можете сделать простую функцию следующим образом:
// Provided 'c' is only a numeric character int parseInt (char c) { return c - '0'; }