About Me

All about Real time requirements in Orale Stay Tune!!

Monday, March 17, 2008

RTTI - What is RTTI?


RTTI - What is RTTI?


Answer1.
RTTI stands for "Run Time Type Identification". In an inheritance hierarchy, we can find out the exact type of the objet of which it is member. It can be done by using:
1) dynamic id operator
2) typecast operator

Answer2.
RTTI is defined as follows: Run Time Type Information, a facility that allows an object to be queried at runtime to determine its type. One of the fundamental principles of object technology is polymorphism, which is the ability of an object to dynamically change at runtime.



STL Containers - What are the types of STL containers?

There are 3 types of STL containers:

1. Adaptive containers like queue, stack

2. Associative containers like set, map

3. Sequence containers like vector, deque


Virtual Destructor - What is the need for “Virtual Destructor?


Destructors are declared as virtual because if do not declare it as virtual the base class destructor will be called before the derived class destructor and that will lead to memory leak because derived class’s objects will not get freed.Destructors are declared virtual so as to bind objects to the methods at runtime so that appropriate destructor is called.

0 comments: