Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class base
- {
- public:
- base() { }
- ~base() { }
- virtual void saida() { cout << "base" << endl; }
- };
- class extra : public base
- {
- public:
- extra() { }
- ~extra() { }
- void saida() { cout << "extra" << endl; }
- };
- class derivada : public extra
- {
- public:
- derivada() { }
- ~derivada() { }
- };
- int main() {
- base* b = new derivada;
- b->saida();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement