What type? At Run-Time
The typeid operator relies on information stored in an
object by the compiler whenever a direct or indirect base
class contains a virtual function.
This operator is used at run time to compare the type of an
object with the type of a known class.
The typeid operator returns a reference to an object of type
type_info. This object contains a compiler dependent run
time representation for a particular type.
This object can be compared with the type_info of known
classes to determine the type at run time.
The header file <typeinfo> must be included to use the
typeid operator.