What is the significance of this expression "str[i] - '0' > 7"? How we decide that it should be greater than 7?

Tags: #<Tag:0x00007f1828268738>


Please explain this.


The value of INT_MAX is 2147483647. If the digit at the last position is less than or equal to 7,the value lies within the range of int. Otherwise it exceeds the limit and so we return INT_MAX or INT_MIN as the return value according to the sign.


Please tell me already reached INT_MAX value then how str[i]-'0>7 matters??