I'm trying to understand and practice Polymorphism, but I don't understand something. When a tutorial started to explain Inheritance, it gave as the main reason to use it is "code reuse". But when using polymorphism, you're writing code again, right? So you're not really reusing code?
EDIT:
Second question:
Why would you override virtual functions?
For example, you have a base class with virtual void testfunction();, but the derived class also has a virtual void testfunction();. Why do you need to override the one in the derived class?