大佬们 请帮忙分析下这个程序那个环节出了问题 错误提示我注释在下面了
#define _CRT_SECURE_NO_WARNINGS#include<iostream>
using namespace std;
#include "Myvector.cpp"
class Teacher
{
public:
Teacher(char* name, int age)
{
this->age = age;
strcpy(this->name, name);
}
void printT()
{
cout << name << "------" << age << endl;
}
private:
int age;
char *name;
};
int main(void)
{
Teacher t1("t1", 31), t2(32, "t2"), t3(33, "t3");
system("pause");
return 0;
}
// error C2664: “Teacher::Teacher(Teacher &&)”: 无法将参数 1 从“const char [3]”转换为“char *”
// note: 从字符串文本转换将丢失 const 限定符(请参阅 /Zc:strictStrings)