Mark a base class function Write Virtual functions have a small runtime cost: each call looks up the function address in a table. But this cost is tiny compared to the flexibility you gain.
Understanding this concept deeply will help you write better code. Practice with examples until the pattern becomes automatic. Review earlier sections if anything is unclear. Building on solid foundations makes advanced topics easier.