no instance of constructor "Employee::Employee" matches the argument list

class Hourly :public Employee
{
protected:
double wage;
double hours;
string category;

public:

Hourly():Employee()
{
}

Hourly(string firstName, string lastName, char gender, int dependents, double wage, double hours, Benefit benefits, string category):Employee(firstName, lastName, gender, dependents, benefits)
{
setWage(wage);
setHours(hours);
setCategory(category);
setAnnualSalary(wage, hours);
}

Hourly(double wage, double hours, string category):Employee()
{
setWage(wage);
setHours(hours);
setCategory(category);
}

Last edited on
error C2661: 'Employee::Employee' : no overloaded function takes 5 arguments
IntelliSense: no instance of constructor "Employee::Employee" matches the argument list
argument types are: (std::string, std::string, char, int, Benefit)
1. Please use code tags to make your code readable:

http://www.cplusplus.com/articles/z13hAqkS/

2. Does your Employee class actually have a constructor that takes 5 arguments like that? Without seeing the class definition, we can't tell.
Topic archived. No new replies allowed.