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 object in oop?
How is class defined?
to find out the minimum of two integer number of two different classes using friend function
Why multiple inheritance is not allowed?
What is polymorphism in oops with example?
What are the advantages of polymorphism?
Whats is abstraction in oops?
is there any choice in opting subjects like 4 out of 7
Get me a number puzzle game-program
Why do we need oop?
What is encapsulation in oops?
Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.
What is data binding in oops?
Which language is not a true object oriented programming language?
Give two or more real cenario of virtual function and vertual object