reminder, we are still not talking about cartoon characters. We are
talking about symbols or letters which make up strings, i.e., the char
Interestingly, the same mathematical operations that work on integers
also work on characters. For example
cLetter = 'a'; // cLetter has 'a' value
cLetter = 'a' + 1
; // cLetter has 'b' value now
The last line gives a
result that uses the fact that the character is stored as an integer
even though it is of type char. The standard (ASCII) value for ‘a’ is
97 and for ‘b’ is 98. Similarly ‘a’ – 3 will give ‘^’.
Although it is
syntactically legal to multiply characters, it is almost never useful
to do it.