jweinst1
2/14/2020 - 7:15 AM

important to digit macro in C

important to digit macro in C

#define TO_DIGIT(d) (((d) >= '0' && (d) <= '9') ? (d) - '0' : -1)

#define TEST_TO_DIGIT(d) printf("digit of %c is %d\n", d, TO_DIGIT(d))