//emplyee.h类文件
class emplyee
{
public:
employee(char p1[],char p2[],char p3[],char p4[]);
void display();
void chang_name(char *p);
~emplyee();
private:
char stampnum[10];
char city[10];
char address[20];
char name[20];
};
//emplyee.cpp类的实现
#include "emplyee.h"
#include<iostream>
#include<cstring>
using namespace std;
emplyee::employee(char p1[], char p2[], char p3[], char p4[])
{strcpy(name ,p1);
strcpy(address,p2);
strcpy(city,p3);
strcpy(stampnum,p4);
}
emplyee::~emplyee()
{
}
void emplyee::chang_name(char *p)
{
strcpy(name,p);
cout<<"The name of another woker is:"<<name<<endl;
}
void emplyee::display()
{
cout<<"人员的信息为:"<<endl;
cout<<"姓名为: "<<name<<endl;
cout<<"地址为: "<<address<<endl;
cout<<"城市是: "<<city<<endl;
cout<<"邮政编码是: "<<stampnum<<endl;
}
//main.cpp主函数
#include "emplyee.h"
#include<iostream>
using namespace std;
void main()
{
emplyee woker1("wang","沈河区","辽宁沈阳","110015");
woker1.display();
}
..................................
出项以下错误:
D:\c+++\MSDev98\MyProjects\人员信息管理1\lap_cpp5main.cpp(7) : error C2661: 'emplyee::emplyee' : no overloaded function takes 4 parameters
构造函数为啥不能调用?
麻烦哪位大虾指点指点,不胜感激!!!