Quite often in the code you can see strings like
char cdigit = '8'; int idigit = cdigit - '0'; Rarer, but also occurs
char letter = 'd'; int letter_number = letter - 'a'; We open the Straustrup "C ++ programming language" special edition, "Binom-Press", 2008. Quote (page 110):
It is unsafe to assume ... that the characters of the alphabet are continuous (in the EBCDIC standard there is a gap between i and j)
For Kernighan and Ritchie, the above code (at least in numbers) is met regularly.
Actually the question on the numbers: is the idigit = cdigit - '0' code idigit = cdigit - '0' ?
atoi. I wonder how it is written. I found only heders. - andy.37