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