??????????????
?????????????????Щ??????????á???????????????????????????????????????????????????????????????????????????????????????????????????????????????c++?????????????????麯????????????????????????????????????????????????????ο?????????????????????????????????????
Class IPerson
{
public??
IPerson(){};
virtual ~IPerson()=0;//????????????????????????????????????????????????????????????
//??????????????????????麯??
virtual void SetName??const string &strName??= 0;
virtual const string GetName????= 0;
virtual void Work????= 0;
}
??????????????
????????????????н???????????????????????????????Ч?????????ν?????
Class CTeacher??public IPerson
{
public??
CTeacher(){};
virtual ~CTeacher??????
string m_strName??
void SetName??const string &strName??;
const string GetName????;
void Work????;
}
CTeacher????SetName??const string &strName??
{
m_strName = name;
}
const string CTeacher????GetName????
{
return m_strName;
}
void CTeacher????Work????
{
cout <<"I am teaching!"<<endl;//????????????飬??????????????????????????
}