What is Run Time Type Identification (RTTI) and typeid operator in C++?

In languages which show the characteristics of polymorphism, such as C++, the type of the object is not always determined in the compile time, it is sometimes done in the run time. This process is known as Run Time Type Identification. The type of an object is determined by using typeid operator and by including the header file <typeinfo>.



Some points about typeid operator:

1) typeid can be used to determine the type of an object at run time.

2) Use of typeid can be extended to template classes.

Leave a Reply