Which of the following must be ensured in order to implement a polymorphic function in C++?
A. There has to be a pointer of the derived class that has implemented the polymorphic function that holds the address of the derived class object.
B. The function must be declared as virtual in both the base class and in the derived class that overrides the function.
C. The function must be declared as pure virtual.
D. There has to be a base class pointer holding the address of a base or derived class object that has implemented the polymorphic function.
E. The function must be declared as virtual in the base class.
Ok so for this I feel:
* A is incorrect - but I really don't understand the answer given.
* B is incorrect, because virtual keyword is not need in the derived class.
* C is incorrect. because to be polymorphic it doesn't have to be pur virtual.
* D is incorrect - but I really don't understand the answer given.
* E is correct,