Semester : SEMESTER 6
Subject : Object Oriented Programming
Year : 2018
Term : MARCH
Scheme : 2015 Full Time
Course Code : EC 312
Page:16
1.
{ cout<< "show derived class" <
int main ()
1
base *bptr;
derived d;
bptr = &d;
//virtual function, binded at runtime
bptr->print () 7
// Non-virtual function, binded at compile time
print derived class
show base class
bptr-
>show();
Output:
class Employee{
float salary=40000;