int main() { Person* per=new_Person("number1","number2"); Person* emp=new_Employee("number3","number4",32.0); //printf("%d %d\n",p->a,p->b); per->_display(per); emp->_display(emp); //displayPerson(p); return 0; }
int main(int argc, char **argv) { Persion *pObj = new_Persion("Fred", "Cui"); if (!pObj) { return -1; } Persion *pEmpObj = new_Employee("swust", "wang", "MIB", "sony", 100); if (!pEmpObj) { return -1; } pObj->Display(pObj); pObj->WriteToFile(pObj, "test.txt"); pObj->Delete(pObj); pEmpObj->Display(pEmpObj); pEmpObj->WriteToFile(pEmpObj, "aa.txt"); pEmpObj->Delete(pEmpObj); return 0; }