Bloomberg LP Interview Question
Financial Software DevelopersCountry: United States
Interview Type: In-Person
In this question there is no difference if the classes are polymorphic or not, as no dynamic_cast operator is used.
A* a;
B* b;
C* c;
D* d;
In the following no dynamic_cast is used, so only the last two cases will work
foo (a); // error
foo (b); // error
foo (c); // ok - implicit conversion
foo (d); // ok - type matching
Here occurs implicit conversion, which only converts from derived to base class.
Objects of class c and D
- Anonymous September 16, 2011