47pitch
asked on
derived class constructor
in C++, does a derived class constructor "automatically" call the base class constructor?
Yes - more specifically, the default constructor is called - if you need another ctor, you can call it in the derived class' ctor's initializer list. See also e.g. http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8a.doc%2Flanguage%2Fref%2Fcplr388.htm ("Initializing base classes and members (C++ only)"): "If you do not explicitly initialize a base class or member that has constructors by calling a constructor, the compiler automatically initializes the base class or member with a default constructor."
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.