开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜