Unable to understand function Atoi - * string - '0'

What exactly does the operator do below?

const char *string
*string - '0'

Thank!

+3
source share
1 answer

It subtracts the value of the symbol '0'from the symbol to which it points string, turning it into a numerical value. For example, a character '9'will be converted to an integer 9.

+9
source

All Articles