previous | start | next

Calling the Base-Class Constructor (Syntax 11.2 Constructor with Base-Class Initializer)

Syntax 11.2 : Constructor with Base-Class Initializer

Derived_class_name :: Derived_class_name(expressions)  :Base_class_name(expressions){   statements
}
Example:
Manager::Manager(string name, double salary, string dept)
   : Employee(name, salary)
{
   department = dept;
}
Purpose: Supply the implementation of a constructor, initializing the base class before the body of the derived-class constructor.


previous | start | next