I\'m trying to read unknown number of integers by this piece of code:
while (1) { int c = getchar (); if (c == EOF) break; el
The character '0' does not have ASCII value 0. However, fortunately the character '1' does have ASCII value '0' + 1, and so forth through 2, 3, 4, 5, 6, 7, 8, and 9. Therefore (pseudo code) 'n' - '0' == n holds for each digit.
'0'
'1'
'0' + 1
'n' - '0' == n