One such example is pure virtual function:-
#include <iostream>
using namespace std;
class Exforsys
{
public:
virtual void example()=0; };
class Exf1:public Exforsys
{
public:
void example()
{
cout << "Welcome";
}
};
class Exf2:public Exforsys
{
public:
void example()
{
cout << "To Training";
}
};
void main()
{
Exforsys* arra[2];
Exf1 e1;
Exf2 e2;
arra[0]=&e1;
arra[1]=&e2;
arra[0]->example();
arra[1]->example();
}
<img src="http://www.exforsys.com/images/cpp/34_2.jpg" alt="Output"/>