+56 votes
by

1 Answer

0 votes
by

Pointer overloading is another name for polymorphism. You
declare a class virtual and then derive some classes from it. You
delare a pointer to the base class and, at run time, assign a value
to that pointer that refers to any of the classes in the derivation
hierarchy. Deferencing that pointer, then, will properly choose the
correct method based on which type of class was used, at run
time.
This works because each class type that is virtual contains a
static v-table of methods that is used to choose the actual method
to use at run time.

Categories

653k questions

2.7m answers

0 comments

50.1k users

Most popular tags

Welcome to The Dog Visitor Q&A [2022], where you can ask questions and receive answers from other members of the community.
...