Game Development Reference
In-Depth Information
•
the string
"123"
and the
int
value
123
•
the
char
value '+' and the operator +
•
the
char
value 'x' and the variable name
x
•
the
char
value '7' and the
int
value
7
11.6.1.3 Special
char
Values
Special symbols are, simply because they are
special
, not always possible to indi-
cate easily using a single character between single quotes. So, a number of special
symbols have special notations, using the backslash symbol:
•
'\n'
for the end-of-line symbol
•
'\t'
for the tabulation symbol
This introduces a new problem: how to indicate the backslash character itself? The
backslash character is indicated using the
double backslash
. In a similar way, the
backslash symbol is used to represent the character for the single and double quotes
themselves:
•
'\\'
for the backslash symbol
•
'\''
for the single quote character
•
'\"'
for the double quote character
In these cases there are two symbols between the single quotes, but together, they in-
dicate a single
char
value. These special symbols are specified in the syntax diagram
that describes the symbol syntax:
11.6.1.4 Calculating Things with
char
The symbols in the Unicode table are ordered: every symbol has its own number.
For example, the number of the capital letter 'A' is 65, the number for 'a' is 97.