Page 26 - DCAP404 _Object Oriented Programming
P. 26
Unit 2: Beginning of OOP Language
Explain the operators Notes
Discuss the control structures
Explain the scope resolution operator
Describe the member dereferencing operator
Recognize the reference variable
Introduction
C++ is a language in essence. It is made up of letters, words, sentences, and constructs just like
English language. This unit discusses these elements of the C++ language along with the operators
applicable over them.
2.1 Review of Tokens
As we know, the smallest individual units in a program are known as tokens. C++ has the
following tokens:
1. Keywords
2. Identifiers
3. Constants
4. Strings
5. Operators
A C++ program is written using these tokens, white spaces, and the syntax of the language. Most
of the C++ tokens are basically similar to the C tokens with the exception of some additions and
minor modifications.
Did u know? How tokens are being separated?
Tokens are usually separated by “white space.” White space can be one or more:
(a) Blanks
(b) Horizontal or vertical tabs
(c) New lines
(d) Formfeeds
(e) Comments
2.1.1 Keywords
The keywords implement specific C++ language features. They are explicitly reserved identifiers
and cannot be used as names for the program variables or other user-defined program elements.
Table 2.1 gives the complete set of C++ keywords. The keywords not found in ANSI C are shown
boldface. These keywords have been added to the ANSI C keywords in order to enhance its
features making it an object-oriented language.
LOVELY PROFESSIONAL UNIVERSITY 19