#include <iostream>
using namespace std;
class Base
{
public:
virtual void PrintfName() = 0;
virtual void PrintfSchool() = 0;
};
class Student1 : public Base
{
public:
void PrintfName()
{
cout << "Student1Name"<< endl;
}
void PrintfSchool()
{
cout << "Student1School"<<endl;
}
};
class Student2 : public Base
{
public:
void PrintfName()
{
cout << "Student2Name"<< endl;
}
void PrintfSchool()
{
cout << "Student2School"<< endl;
}
};
class Direver
{
public:
Direver(Base *base)
{
pbase = base;
}
void Construct()
{
pbase->PrintfName();
pbase->PrintfSchool();
}
private:
Base *pbase;
};
int main()
{
Direver d(new Student2());
d.Construct();
return 0;
}