I think the point wrt non-contiguous '0'..'9' is that you don't really gain anything if they're contiguous. Instead of #define val(c) ((c) - '0') you can just use char digits[] = "0123456789"; #define val(c) (strchr(digits, (c)) - digits) and instead of #define str(n) ((n) + '0') you can just use #define str(n) (digits[n]) ajr