My base class is located in Employee.h and this is the code for the constructor.
Employee(string Fname = "First Name not Set.",
string Lname = "Last Name not Set.");
This is the code for the Employee.cpp
Employee :: Employee(string Fname = "First Name not Set.",
string Lname = "Last Name not Set.")
: FirstName(Fname), LastName(Lname)
{
}
The problem are both my constructors and it says their parameters are wrong but I'm not sure what is wrong with them.
Manager.h
class Manager: public Employee
public:
Manager(string Fname = "First Name not Set.",
string Lname = "Last Name not Set.", double sal = 0.0,
string BTitle = "Boss's Title not Set."): Employee (Fname,Lname){}
Manager.cpp
Manager :: Manager(string Fname = "First Name not Set.",
string Lname = "Last Name not Set.", double sal = 0.0,
string BTitle = "Boss's Title not Set."): Employee(Fname, Lname)
{
FirstName = Fname;
LastName = Lname;
salary = sal;
TitleOfBoss = BTitle;
}
This is error message I am getting:
'Manager::Manager' : redefinition of default parameter : parameter 4: : see declaration of 'Manager::Manager'
'Manager::Manager' : redefinition of default parameter : parameter 3: : see declaration of 'Manager::Manager'
'Manager::Manager' : redefinition of default parameter : parameter 2: : see declaration of 'Manager::Manager'
'Manager::Manager' : redefinition of default parameter : parameter 1: : see declaration of 'Manager::Manager'
Same thing with the Employee constructor.
error C2572: 'Employee::Employee' : redefinition of default parameter : parameter 2: see declaration of 'Employee::Employee'
error C2572: 'Employee::Employee' : redefinition of default parameter : parameter 1: see declaration of 'Employee::Employee'