In the following code, why does the last call of eat() on the reference c return \"An animal b is eating.\" ? From my
You cannot re-bind a reference once you have bound it, so you have to use pointers instead of references:
Animal *c = &a; c->eat(); c = &b; c->eat();
Now it will work exactly as you have wished it.