I had a C ++ exam a few days ago, and I got this question, and I found this incomprehensible to me, the question was:
Explain the difference between the terms Polymorphism, virtual function, and most important. Using the example of obtaining the shape region for a rectangle and a triangle, write two different fragment codes to show the implementation of polymorphism and the implementation of polymorphism and a virtual function.
Give an example of output from both code fragments.
while the definition of polymorphism is in accordance with Absolute C ++ 5th p669:
Polymorphism refers to the ability to bind many values ββto a single function name using a late-binding mechanism. Thus, polymorphism, late binding, and virtual functions are all the same topics.
I understood from this definition that polymorphism does not exist without using virtual functions, right? so there are no two different fingerprint options for this question, right? only one using virtual function
My question is: is the question really asked?
Zingo source share