Friday, October 29, 2010

RTTI-SHAPE HIERARCHY



In programming, RTTI (Run-Time Type Information, or Run-Time Type Identification) refers to a C++ system that keeps information about an object's data type in memory at runtime. Run-time type information can apply to simple data types, such as integers and characters, or to generic objects. This is a C++ implementation of a more generic concept called reflection.

In the original C++ design, Stroustrup did not include run-time type information, because he thought this mechanism was frequently misused

In order for the dynamic_cast<> operation, the typeid operator or exceptions to work in C++, RTTI must be enabled.

With C++ run-time type information, you can perform safe typecasts and manipulate type information at run time.

RTTI is only available for classes which are polymorphic, which means they have at least one virtual method. In practice, this is not a limitation because a class that you intend to use polymorphically should generally have at least a virtual destructor, to allow objects of derived classes to perform proper cleanup.


----------------------------------------------------------------------------------------------

A C++ PROGRAM TO IMPLEMENT RUN TIME TYPE INFORMATION

COMPILER EMPLOYED: DEV C++ COMPILER-4.9.9.2

SOURCE FILE SIZE :3 kb

EXE FILE SIZE :580 kb

NOTE: PLEASE INCLUDE THE DESIRED HEADER FILE

---------------------------------------------------------------------------------------------

C++ PROGRAM SOURCE & EXE DOWNLOAD:

Click download button to download

DISCLAIMER: The following program cannot be ensured of perfection.so any flaws in the program can be notified in the comments section.

----------------------------------------------------------------------------------------------
Your's friendly,
[MOHANRAM.G],
ADMIN...

0 comments:

Post a Comment