Week 4 lect# 1
Object as function argument
Assigning Objects
Assigning objects
An object can be assigned to another object of the same type using the
assignment operator (=)
Member by member copy
rational r1,r2,r3,r4;
r3.print();
r4=r3;
r4.print();
O

Week 4 lect 2
Static and const data and member
functions
Static Keyword
We can defne class members static usingstatickeyword. When we
declare a member of a class as static it means no matter how many
objects of the class are created, there is only one co

STRUCTURES
Chapter No. 4
Structure
A structure is a collection of simple variables. The variables in a
structure can be of different types: Some can be int, some can be float,
and so on.
The data items in a structure are called the elements or members o

Functions
Week 5 (lect#2)
Inline Function
The
inline function is a special
function. It is a user defined
function but in it the function
prototype is omitted. The
keyword inline is used in the
declarator of the function
definition. The function is defin

Constructor &
Destructor
Chapter No. 6
Lecture 6
Accessing member functions
outside the class
The member functions outside the class are defined in similar way as
user defined function are defined.
However, in the header of function definition the scope

Object Oriented
Programming
Classes and objects
The Object Oriented Approach
The fundamental idea behind object-oriented languages is to combine
into a single unit both data and the functions that operate on that
data. Such a unit is called an object.
A

Inheritance
Week6 (lect #1)
Inheritance
The
word inherit means to receive. Inheritance enables new
classes to receiveorinheritthe properties and methods of
existing classes.
The new class that can access the members of existing class
is called derived cla

Functions
Chapter 5
FUNCTIONS
Functions allow to structure programs in segments of code
to perform individual tasks.
In C+, a function is a group of statements that is given a
name, and which can be called from some point of the
program. The most common s