int func(B2* obj1,B2* obj2){ return obj1 == obj2; } D* d_ptr = new D(); B2* b2_ptr = dynamic_cast(d_ptr); func(d_ptr,b2_ptr); --> return true