Question OOP-POLY-0060
MediumWhat does dynamic_cast<Derived*>(basePtr) return in C++ if the object is not a Derived?
- A.
It throws for pointers
- B.
A new Derived object
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Polymorphism question
What does dynamic_cast<Derived*>(basePtr) return in C++ if the object is not a Derived?
It throws for pointers
A new Derived object
Sign up free to see the answer and a step-by-step explanation.
The same pointer
nullptr