Computer Project Work: Getting Started With C++ Guided By:-Prepared By
Computer Project Work: Getting Started With C++ Guided By:-Prepared By
Types of Tokens
Keywords
Identifiers
Literals
Punctuators
Operators
KEYWORDS
Keywords are the words that convey a
special meaning to the language compiler.
These are reserved for special purpose
and must not be used as normal identifier
names.
Some of the keywords in c++
asm continue float new signed try
auto default for operator sizeof typedef
break delete friend private static union
case do goto protected struct unsigned
catch double if public switch virtual
char else inline register template void
class enum int return this volatile
const extern long short throw while
Identifiers
Identifiers are names of the program
given by user.
Rules to write identifiers
1. Do not start with digits.
2. No special symbols are used except
_(underscore).
3. No spaces are used.
Examples:- myfile , date9_2_7_6
Literals
Literals (constants) are data items that
never change their value during a
program run.
Types of Literals:
1. Integer constant
2. Floating constants
3. Character constant
4. String literal
Integer constant
Integer constants are whole numbers
without any fractional part.