Question
a.
Parent *p=child;
b.
Parent *p=*child;
c.
Parent *p=&child;
d.
Parent *p=Child();
Posted under Object Oriented Programming
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. If two classes are defined “Parent” and “Child” then which is the correct type upcast syntax in C++?
Similar Questions
Discover Related MCQs
Q. What is downcasting?
View solution
Q. Which among the following is a mandatory condition for downcasting?
View solution
Q. Downcasting is _______________________
View solution
Q. Downcasting ____________________
View solution
Q. What should be used for safe downcast?
View solution
Q. What does dynamic_cast return after successful type casting?
View solution
Q. If dynamic_cast fails, which value is returned?
View solution
Q. Which is the proper syntax of dynamic_cast?
View solution
Q. Which is the exception handler for the exceptions of downcasting?
View solution
Q. How to prevent the ClassCastExceptions?
View solution
Q. Java supports direct downcasting.
View solution
Q. Which way the downcasting is possible with respect to inheritance?
View solution
Q. What happens when downcasting is done but not explicitly defined in syntax?
View solution
Q. When is downcating used?
View solution
Q. Why is downcasting possible in any language?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Object Oriented Programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!
Java Programming
Level up your coding skills with our Java Programming MCQs. From object-oriented...
Microprocessor
Understand the heart of your computer with our Microprocessor MCQs. Topics include...
Cyber Security
Understand the fundamentals of safeguarding digital assets with our Cyber Security...