- Array subscripts always start with zero in C (ie. ndigit[0] )
- A subscript can be any integer expression; which include integer variable (ie. i) and integer constant
- By definition, chars are just small integers, so char variables and constants are identical to ints in arithmetic expressions. (ASCII numeric value of '0' is 48 decimal, of '1' is 49 decimal, etc)
- c - '0' is an integer expression with a value between 0 and 9 corresponding to the character '0' to '9' stored in c, and is thus a valid subscript for the array ndigit.
ndigit is an array of 10 integers |
- If else
- Any statement can be several statements enclosed in braces
No comments:
Post a Comment