1

Possible Duplicate:
Calling virtual functions inside constructors

in C++, An object of class B derived from class A, in C++ the c’tor of A is invoked before the c’tor of B , why ? And what happens if A’s C’tor invokes a virtual function? does it invoke A's virtual function of B's ?

Community
  • 1
  • 1
nabil
  • 904
  • 3
  • 12
  • 28

1 Answers1

0

Most of your questions, if not all, are covered by the C++ FAQ.

E.g. see the FAQ "When my base class's constructor calls a virtual function on its this object, why doesn't my derived class's override of that virtual function get invoked?".

It is always a good idea to read the FAQ before asking.

Cheers and hth. - Alf
  • 142,714
  • 15
  • 209
  • 331