Practice exercise -- Tokens: basic elements of C++
Special symbols:
mathematical: + - * /
punctuation: . ; ? ,
logical: <= == != >= (two-character symbols)
other: ( ) { } [ ] blank ...
Word symbols: reserved words or keywords, always lowercase
int, double, float, char, const, void, return ...
Identifiers: names of things that appear in a program;
they consist of letters, digits, and the underscore character (_).
They should not start with a digit, and are case-sensitive.
Two predefined identifiers are cin and cout.
Indicate whether the following would be classified as a special symbol, word
symbol, identifier, or is invalid:
Token Special symbol Word Symbol Identifier Invalid
-------- -------------- ----------- ---------- -------
*
int
lastName
$amount
r2d2
double
cin
3D
PI
!=
one Way
Void
LAB_FEE
SQL+