#include <iostream>
using namespace std;
class Person{
public:
virtual void gift()=0;
};
class Boy:public Person{
public:
void gift(){
cout<<"Gift: Watch"<<endl;
}
};
class Girl:public Person{
public:
void gift(){
cout<<"Gift: Saree"<<endl;
}
};
int main() {
Boy b1;
Girl g1;
//Base class pointer and Derived class object
Person *ptr=NULL;
//late binding or dynamic binding
ptr= &b1;
ptr->gift();
ptr= &g1;
ptr->gift();
cout<<"Dynamic memory allocation using keyword new"<<endl;
ptr=new Boy; // Dynamic memory allocation
ptr->gift();
return 0;
}