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...

In c++ there is only virtual destructors, no constructors. Why?

Answer Posted / uma sankar pradhan

constructors are invoked at the time of object creation.
The v-table for virtual function mechanism is not
intialised properly during the constructor invocation.
So constructors cannot be virtual

But,destructors can be virtual.Because the V-table is
properly initialised at the time of object creation.
So the v-table is available for the destructors.
Destructors can be made pure virtual also.But unlike other
member functions,it must be redfined outside the class.

Is This Answer Correct ?    57 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is byval and byref? What are differences between them?

2272


They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

1967


What is the important feature of inheritance?

1189


Why do while loop is used?

1098


Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box

2684


Write a program to reverse a string using recursive function?

2415


What is the renewal class?

2823


What is debug class?what is trace class? What differences are between them? With examples.

2264


What is multilevel inheritance in oop?

1089


What is constructor in oop?

1176


What is abstract class in oops?

1077


Why do we use encapsulation in oops?

1089


Why is oop better than procedural?

1145


What is abstraction and encapsulation?

1065


What are the types of abstraction?

1154