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
Why do pointers exist?
Can enum be null?
Why do we use inheritance?
What is difference between polymorphism and inheritance?
2. Give the different notations for the class.\
How is class defined?
Please send ford technologies placement paper 2 my mail id
What is encapsulation process?
What is constructor overloading in oop?
How to call a non virtual function in the derived class by using base class pointer
What is encapsulation example?
Can static class have constructor?
What is encapsulation in ict?
Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)
What is the purpose of enum?