Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Why do pointers exist?

1151


Can enum be null?

1071


Why do we use inheritance?

1193


What is difference between polymorphism and inheritance?

1132


2. Give the different notations for the class.\

2223


How is class defined?

1208


Please send ford technologies placement paper 2 my mail id

2148


What is encapsulation process?

1106


What is constructor overloading in oop?

1180


How to call a non virtual function in the derived class by using base class pointer

6686


What is encapsulation example?

1122


Can static class have constructor?

1085


What is encapsulation in ict?

1118


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!!!)

2158


What is the purpose of enum?

1056