我收到以下错误,我无法弄清楚原因:
Could not find a match for 'PEmployee::PEmployee(char *, double)' in function main()
这是我的代码:
class PEmployee
{
public:
PEmployee();
PEmployee(string employee_name, double initial_salary);
void set_salary(double new_salary);
double get_salary() const;
string get_name() const;
private:
Person person_data;
double salary;
};
int main()
{
PEmployee f("Patrick", 1000.00);
cout << f.get_name() << " earns a salary of ";
<< f.get_salary() << endl;
return 0;
}
有人能告诉我为什么我会收到这个错误吗?
谢谢。