1#include <iostream>
2#include <string>
3
4using namespace std;
5
6class Person{
7public:
8 void introduce(){
9 cout <<"hey from person"<<endl;
10 }
11};
12
13class Student : public Person{
14public:
15 void introduce(){
16 cout <<"hey from student"<<endl;
17 }
18};
19
20void whosThis(Person &p){
21p.introduce();
22}
23
24int main()
25{
26 Student anil;
27 anil.introduce();
28 whosThis(anil);
29 return 0;
30}
31
32