## Advanced Topic 20.1

Overriding, Shadowing, and Scopes

- Overloading an inherited member function hides that function:

>     class Employee
>     {  . . .
>        virtual void set_salary(int new_salary);
>     };
>     class Manager : public Employee
>     {  . . .
>        virtual void set_salary(int new_salary, int yearly_bonus);
>     };
>     Manager m;
>     m.set_salary(45000); // Error - requires 2 args

prev |top |next