I was looking at tutorials on OOP using C++, and to explain polymorphism and abstract classes, following slide was used:
So, you can see, a base class called 'base' and two derived classes 'savings' and 'current' are defined, and then address of a 'savings' object (and later 'current' object) is assigned to the 'base' pointer.
Although I understand how the function behaves according to context, I don't quite get why and where I would want to do such a pointer assignment. Can someone please explain? Also, if there is a better example to demonstrate the same concept, that will be appreciated too.
