## 21.3 Virtual and Nonvirtual Overriding (cont.)

>     class Manager : public Employee
>     {
>        . . .
>        virtual void print(ostream& out) const;
>     };

>     void Manager::print(ostream& out) const
>     {
>        out << "Manager " << name();
>     }

>     ostream& operator<<(ostream& out, const Employee& e)
>     {
>        e.print(out);
>        return out;
>     }

prev |top |next