一直提示错误 找不到啊
#include<iostream>
#include<stdlib.h>
#include<string>
using namespace std ;
int main(void)
{
Teacher t1;
Teacher t2("marry",12);
system ("pause");
return 0;
}
class Teacher
{
public :
Teacher();
Teacher(string _name,int _age);
void getName(string _name) ;
string getName();
void getAge(int _age);
int getAge();
private :
string m_strName;
int m_iAge;
};
Teacher::Teacher()
{
m_strName = "zhangsan";
m_iAge = 5;
cout << "Teacher()" <<endl;
}
Teacher::Teacher(string _name,int _age)
{
m_strName=_name;
m_iAge=_age;
cout << "Teacher(string _name,int _age)" <<endl;
}
void Teacher::getName(string _name)
{
m_strName=_name;
}string Teacher::getName()
{
return m_strName;
}
void Teacher::getAge(int _age)
{
m_iAge=_age;
}
int Teacher::getAge()
{
return m_iAge;
}