#Would this output ACEFDB?

5 messages · Page 1 of 1 (latest)

mortal impBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

paper sigil
#
class Pet {
public:
  Pet() { cout << "A ";}
  ~Pet() { cout << "B "; }
};

class Bird : public Pet {
public:
  Bird() { cout << "C "; }
  ~Bird() { cout << "D "; }
};

class Parrot : public Bird {
public:
  Parrot() { cout << "E"; }
  virtual ~Parrot() { cout << "F "; }
};

int main() {
  Bird* ptr = new Parrot();
  delete ptr;
}
mortal impBOT
#

@paper sigil

Please Do Not Delete Posts!

Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.

paper sigil
#

!solved

mortal impBOT
#

Thank you and let us know if you have any more questions!

This thread is now set to auto-hide after an hour of inactivity