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

What is object and example?

1178


class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash

2285


What are the benefits of interface?

1061


What is encapsulation oop?

1041


Why is object oriented programming so hard?

1082


What is the oops and benefits of oops programming?

975


What is variable example?

1036


Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)

4147


What is class and object with example?

1130


What is encapsulation in oop?

1052


What is the purpose of enum?

1011


What is the main feature of oop?

1151


What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?

2132


What is the difference between a constructor and a destructor?

1260


There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.

1995