#include"person.h"
void main()
{
Person t("yang",12,'m', "zhong",123456);
Teacher r("yang",12,'m',"zhong",123456,"student");
Person *pt=&t;
pt->ShowPerson();
pt=&r;
pt->ShowTeacher();
void main()
{
Person t("yang",12,'m', "zhong",123456);
Teacher r("yang",12,'m',"zhong",123456,"student");
Person *pt=&t;
pt->ShowPerson();
pt=&r;
pt->ShowTeacher();
}
error C2039: 'ShowTeacher' : is not a member of 'Person'
c:\c++\5\5\person.h(6) : see declaration of 'Person'
执行 cl.exe 时出错.