In the following code, why does the last call of eat() on the reference c return \"An animal b is eating.\" ? From my
Animal & c = a; c.eat(); c = b; ///^^^ c.eat();
In C++, reference cannot be rebind to other object once it is being initialized. c is still an alias of object a, which is an Animal, therefore, you saw the output which is expected.
c
a
Animal