【求助】 no matching function for call to `strcpy(std::string&, char*&)'

#include 
#include
using namespace std;
class Teacher
{
   public:
  Teacher(string nam,int a,string t)
{
 name=nam;
age=a;
title=t;
}
void diaplay()
{
cout<<"name:"< cout<<"age:" < cout<<"title:"< }
   protected:
string name;
int age;
string title;
};
class Student
{
   public:
Student(char nam[],char s,float sco)
{
    strcpy(name1,nam);
    sex=s;
    score=sco;
      }
      void display()
      {
cout<<"name:"< cout<<"sex:"< cout<<"score:"<       }
   protected:
 string name1;
 char sex;
 float score;
};
class Graduate:public Teacher,public Student
{
  public:
Graduate(string nam,int a,char s,string t,float sco,float w):acher(nam,a,t),Student(nam,s,sco),wage(w){}
void show()
{cout<<"name:"<  cout<<"age:" <  cout<<"sex:"<  cout<<"score:"<  cout<<"title:"<  cout<<"wage:"< }
       protected:
  float wage;
};
int main()
{
  Graduate grad1("Wang-lin",24,'f',"assistant",89.9,1234.5);
  grad1.show();
  system("pause");
  return 0;

}




编译结果:



你可能感兴趣的:(C++)