quote:Original post by biovenger
No, the derived constructor gets called first, then the default base constructor (BaseClass(); {}).
You''re wrong. Have you even tried this?
Here''s some proof code.
#include <iostream>class CBase{ public: CBase() { std::cout << "CBase::CBase()\n"; }};class CDerived : public CBase{ public: CDerived() { std::cout << "CDerived::CDerived()\n"; }};int main(){ CDerived myClass; return 0;}
Gosh, it runs the base-class ctor first! fancy that!
Don''t listen to me. I''ve had too much coffee.