c - What does s[i] - '0' mean? -
the following code k&r textbook, page number 71:
val =10.0*val+s[i] -'0' what s[i] -'0' mean here?
it converts int in char form actual int.
for example, if s[i] '9' s[i] - '0' produce 9.
the following code k&r textbook, page number 71:
val =10.0*val+s[i] -'0' what s[i] -'0' mean here?
it converts int in char form actual int.
for example, if s[i] '9' s[i] - '0' produce 9.
Comments
Post a Comment