如果你直接在构造函数的括号里写字符串那么编译器会认为你传了一个string,不是char*
解决方法
转换类型(char*)
这是头文件的里面的构造函数的函数头
student::student(int mid,int mage,char* mname,char* mheight)
#include <iostream>
#include "student.h"
using namespace std;
int main()
{
student stu(10,20,(char*)"30",(char*)"40");
cout<<"9999999999"<<endl;
student ssttuu(20,40,(char*)"50",(char*)"70");
cout<<"6666666666"<<endl;
stu.show(stu);
cout<<"3333333333"<<endl;
cout<<"8888888888"<<endl;
return 0;
}