## 21.3 Virtual and Nonvirtual Overriding (cont.)

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

>     ostream& operator<<(ostream& out, const Manager& m)
>     {
>        out << "Manager " << e.name();
>        return out;
>     }

>     Manager man = new Manager(. . .);
>     cout << *man << "\n"; // Executes Manager function

prev |top |next