First page Back Continue Last page Graphics
RTTI
RunTime Type Information.
Example: Prata rtti1 and rtti2
Suppose a hierarchy of classes are descended from a common base. You can set a base class pointer to an object of any class in the hierarchy.
Next:
- call a function that
- does some processing, selects one class, creates an object of that class, returns its address, which gets assigned to a base class pointer.
How can you know which kind of object it points to?