#include <iostream>
#include <string>
using namespace std;
class AbstractStuff {
public:
virtual string show() {
return "Unknown Stuff";
}
protected:
string discription;
};
class BenzCar : public AbstractStuff {
public:
BenzCar() {
discription = "Benz";
}
string show() {
return discription;
}
};
class OtherStuff : public AbstractStuff {
public:
virtual string show() = 0;
protected:
AbstractStuff *stuff;
};
class Wheel : public OtherStuff {
public:
Wheel(AbstractStuff *stuff) {
this->stuff = stuff;
}
string show() {
return stuff->show() + " + wheel";
}
};
int main(int argc, char **argv) {
AbstractStuff *car = new BenzCar();
car = new Wheel(car);
cout << car->show() << endl;
return 0;
}