cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
no instance of constructor "Employee::Em
no instance of constructor "Employee::Employee" matches the argument list
Jun 8, 2015 at 5:15am UTC
alicialng
(23)
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
Jun 8, 2015 at 10:21am UTC
Jun 8, 2015 at 5:16am UTC
alicialng
(23)
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)
Jun 8, 2015 at 10:38am UTC
MikeyBoy
(5631)
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.