Not able to understand Atoi function - *string - '0'
What exactly does the below statement do?
const char *string
*开发者_StackOverflow中文版string - '0'
Thanks!
It subtracts the value of the character '0'
from the character pointed to by string
, turning it into a numerical value. So for example the character '9'
will be turned into the integer 9
.
精彩评论