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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c++ platform dependent?

1071


What is the most powerful coding language?

1053


What is code reusability in c++?

1242


What is the difference between a type-specific template friend class and a general template friend class?

977


Can a program run without main in c++?

1199


Specify different types of decision control statements?

848


Explain rethrowing exceptions with an example?

1019


How one would use switch in a program?

1070


Is swift better than c++?

943


What is the meaning of c++?

1025


What does flush do c++?

1055


What are the 3 levels of programming languages?

1041


Should I learn c or c++ first?

1124


What is the use of c++ programming language in real life?

1044


What is the difference between #define debug 0 and #undef debug?

1179