关于t3的问题
int main(void) { Teacher t1; Teacher t2("merry", 15); Teacher t3("james"); //就是这不对 cout << t1.getName ()<< " " << t1.getAge ()<< endl; cout << t2.getName ()<< " " << t2.getAge ()<< endl; cout << t3.getName ()<< " " << t3.getAge ()<< endl; system("pause"); return 0; }
错误 1 error C2664: “Teacher::Teacher(const Teacher &)”: 无法将参数 1 从“const char [6]”转换为“const Teacher &” c:\users\administrator\documents\visual studio 2013\projects\project1\project1\源.cpp 11 1 Project1
2 IntelliSense: 没有与参数列表匹配的构造函数 "Teacher::Teacher" 实例
参数类型为: (const char [6]) c:\Users\Administrator\Documents\Visual Studio 2013\Projects\Project1\Project1\源.cpp 11 13 Project