C++ requires that for the characters representing decimal digits '0' '1' '2' ... '9' , the value of each character following '0' should be one greater than the the value of the previous character.
For example, in the character encoding in use, if the integer value of character '0' is 72, then the value of '1' would be 73, the value of '2' would be 74 etc.
Therefore '7' - '0' would yield the integer 7.
Using the same encoding as in the example above, '7' - '0' == 79 - 72 == 7
> The integer representation is its ASCII code
Not necessarily. The specific values of the members of the character set in use are locale specific.
Last edited on
this so much makes sense!!! thank you all~~