求助:no appropriate default constructor available
#include<iostream.h>#include<string.h>
class student{
private:
char classes[32];
char name[32];
int score1,score2,score3;
public:
student(); //默认的构造函数,构造函数处理对象的初始化
student(char*,char*,int,int,int); //重载的构造函数
~student(); //析构函数,对象的生命周期结束,撤销对象占用的内存之前的清理工作
char* get_name();
void display();
};
class employee:public student
{
private:
int salary;
public:
employee(int s);
int get_salary();
};
//////////////////////////////////////////////
#include"Exam21.h"
student::student(){}
student::student(char* c,char* n,int s1,int s2,int s3)
{
strcpy(classes,c);
strcpy(name,n);
score1=s1;score2=s2;score3=s3;
}
student::~student(){}
char* student::get_name()
{ return name;}
void student::display()
{
cout<<"classes:"<<classes<<endl;
cout<<"name:"<<name<<endl;
cout<<"score1:"<<score1<<endl;
cout<<"score2:"<<score2<<endl;
cout<<"score3:"<<score3<<endl;
}
employee::employee(int s)
{
salary=s;
}
int employee::get_salary()
{
cout<<"salary:"<<salary<<endl;
}
void main()
{
student xk061[3];
employee ss;
char bj[32],n[32];
int s11,s22,s33;
int s;
for(int i=0;i<3;i++)
{
cout<<"please enter classes,name,score1,score2,score3,salary:"<<endl;
cin>>bj>>n>>s11>>s22>>s33>>s;
xk061[i]=student(bj,n,s11,s22,s33);
ss=employee(s);
}
for(i=0;i<3;i++)
{
xk061[i].display();
ss.get_salary();
}
cout<<"please enter seek name:"<<endl;
cin>>n;
for(i=0;i<3;i++)
{
if(strcmp(xk061[i].get_name(),n)==0)
break;
}
if(i<3)
{
xk061[i].display();
ss.get_salary();
}
else
cout<<"No found!";
}
student基类中派生类employee,成员函数get_salary()
有个错误
'employee' : no appropriate default constructor available求助!!!!