Child cObj = new Parent()
Wahts the output ?
Answer Posted / donga bangarraju
sorry for the earlier post, this output is giving error like
initializing cannot convert to Paretn* to Child*, if u want
correct this code write like this, this is downcasting or
using RTTI mechanism in C++;
Parent* p =new Child;
Child* obj= dynamic_cast<Child*>(p);
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is the purpose of polymorphism?
Why is polymorphism needed?
#include
what type of question are asked in thoughtworks pair programming round ?
What is inheritance in simple words?
Why do we use encapsulation in oops?
What are main features of oop?
What is overriding vs overloading?
Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.
Why multiple inheritance is not allowed?
What is destructor example?
What is overriding in oop?
What is abstraction and encapsulation?
What is encapsulation oop?
What is debug class?what is trace class? What differences are between them? With examples.