0

Hello Friends,

Can you pls. help me in below?
1) Is it possible to invoke derived class constructor from base class constructor some how in C++?
2) If yes, how?

Regards,
Vivek

3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by vivekarora
0

No -- derived class has not been constructed at that point. When an object is instantiated the compiler first calls the base class then all derived classes, working its way up from the bottom to the top of the hierarchy. classes are destroy in the opposite manner.

0

Thank you friends. I agree with you in normal C++ usage. I was wondering if i could some how achieve this e.g. if i know the compiler internal working;).
Anyways, from your point, i understand there is no known way till now to achieve this. So thanks for your valuable comments.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.