This can be a C++ interview test not homework. the exam have been done.
which from the following claims precisely describe basics class destructor calling an online function override of the derived class ?
A. the base class destructor calls the virtual function override of the derived class through the vtable B. the C++ compiler maintains the override virtual function pointers in a separate structure when it sees the call in a destructor. The call is then resolved through this structure. C. the base class destructor calls the virtual function of the base and not of the derived class. D. the base class destructor caanot call the virtual function override of the derived class because the derived class portion of the data may be an undefined state. E. the laguage doe not permit calling a virtual override in either a constructo or the destructor of the base class.
I select B D.
I understand the desctructors ought to be contacted reverse order of constructor. How I don't know from the virtual functions in destrcutor. Correct ?
From things i remember, when base destructor is known as, all derived class destructors happen to be known as and all sorts of details about derived classes sheds ,so "C" appears correct in my experience ( for this reason calling virtual techniques isn't suggested in C++ destructors and constructros)
The reply is C,D. C happens due to the explanation succumbed D.