#include <iostream>
using namespace std;
class Person{
public:
virtual void gift(){
cout<<"Gift: Watch or Saree"<<endl;
}
};
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;
Person *ptr=NULL;
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;
}