+ 2
What is virtual function and why it is used?
In polymorphism module of C++ tutorial (solo learn) I could not understand what was meant by line "Every derived class will override the attack() function and have a separate implementation" https://www.sololearn.com/learn/CPlusPlus/1911/ Can anyone explain? Also please tell What is virtual function and why it is used?
1 Resposta
+ 6
Get more information about this from here ..
https://www.google.com/amp/s/www.geeksforgeeks.org/virtual-function-cpp/amp/
https://www.javatpoint.com/cpp-virtual-function