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


Explain calling an object's member function(declared
virtual)from its constructor?



Explain calling an object's member function(declared virtual)from its constructor?..

Answer / deepak

It will depend on when pointer to vtable is initialised.
generally if constructor is already defined compiler insert
code to initialise virtual table pointer as first statement
inside defined constructor. If vptr is initialised before
calling virtual function then it will be invoked, if vptr is
not initialised then it can crash.

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More C++ General Interview Questions

make a middle node of doubly linklist to the top of the list

1 Answers  


List the special characteristics of constructor.

0 Answers  


How do you flush a buffer in c++?

0 Answers  


What are the differences between java and c++?

0 Answers  


What is the difference between delegation and implemented-in-terms-of?

0 Answers  


Difference between inline functions and macros?

0 Answers  


Explain the operation of overloading of an assignment operator.

0 Answers  


What are the benefits of pointers?

0 Answers  


when can we use copy constructor?

6 Answers   HP,


If horse and bird inherit virtual public from animal, do their constructors initialize the animal constructor? If pegasus inherits from both horse and bird, how does it initialize animal’s constructor?

0 Answers  


Can I learn c++ without c?

0 Answers  


What are the advantages and disadvantages of using inline and const?

2 Answers   Polaris, TCS, Zimmer Biomet,


Categories