1.

Which is the proper syntax of dynamic_cast?(a) dynamic_cast(object)(b) dynamic_cast new (object)(c) dynamic_cast(object)(d) dynamic_cast(object)This question was addressed to me in my homework.Question is from Downcasting in section Default Arguments vs Overloading, Upcasting and Downcasting of Object Oriented Programming

Answer»

The correct CHOICE is (c) dynamic_cast(object)

For explanation: The dynamic_cast is the name of the operator, which is FOLLOWED by the NEW type in which the object have to be converted. Then the object name is GIVEN. This object name is then USED after the type conversion.



Discussion

No Comment Found

Related InterviewSolutions