Unit: 2 Objects and Classes: Trim II, MBA Tech Div A Subject: CP
Unit: 2 Objects and Classes: Trim II, MBA Tech Div A Subject: CP
item x;
• Creates variable x of type item.
• In C++, the class variables are called as
Objects.
• The necessary memory space is allocated to
an object at this stage.
operation on Object x
number: 100
cost :288.34
operation on Object y
number: 40
cost :300.34
count=0;
count=0;
count=0;
count value after reading data
count=3;
count=3;
count=3;
count: 2
count: 3
Object number: 1
Object number: 2
Object number: 3