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 does and I oop mean?
How to hide the base class functionality in Inheritance?
Which language is pure oop?
Why do we use inheritance?
What is object in oop with example?
What is object-oriented programming? Webopedia definition
Why do we use polymorphism?
write a program to find 2^n+1 ?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
What is oops with example?
What is a class and object?
What is difference between abstraction and encapsulation?
what is graphics
Can enum be null?
What is the problem with multiple inheritance?