1 #include <rtl/ustring> 2 #include <stdio.h> 3 #include <typeinfo> 4 #include "samplelibrtti.hxx" 5 6 7 //using namespace salhelper; 8 using namespace rtl; 9 10 11 12 int main( int argc, char *argv[ ], char *envp[ ] ) 13 { 14 MyClassB b; 15 MyClassA* pA= &b; 16 // test the virtual function 17 pA->funcA(); 18 19 // const type_info& i1= typeid ( b); 20 // const type_info& i2= typeid( pA); 21 22 if( typeid( b) == typeid( pA)) 23 printf("\nsame types"); 24 25 26 MyClassB* pB= dynamic_cast<MyClassB* >( pA); 27 pB->funcA(); 28 return 0; 29 } 30