偶虽然也不会C++,但是偶辅导女生却是一流的、有着非常丰富的经验的.....
抢饭碗,不过女生应该不要老头.......
你还是好好先对付静夜思的bc-cn哦...
25号上的了网,啥都没变.....老K可就真的要.......
离开这里,离开你的视野,归隐到属于我的地方,无论何处
晕啊
补什么了
人家明天就要答复了
一晚上能补出点啥
我现在连这个都没弄明白哪错了:
#include <iostream.h>
#include <string.h>
class Person
{
protected:
char m_strName[20];
int m_nAge;
int m_nSex;
public:
Person(char*name,int age,char*sex)
{
strcpy(m_strName,"李四");
m_nAge=20;
m_nSex=0;
}
~Person()
{
cout<<"deconstructor of Person"<<endl;
}
void Register(char*name,int age,char sex)
{
strcpy(m_strName,name);
m_nAge=age;
m_nSex=(sex=='m'?0:1);
}
void Showme()
{
cout<<"姓名:"<<m_strName<<endl;
cout<<"年龄:"<<m_nAge<<endl;
cout<<"性别:"<<(m_nSex==0?"男":"女")<<endl;
}
};
class Teacher:public Person
{
char m_strDept[20];
int m_nSalary;
public:
Teacher(char *name,int age,char sex,char *dept, int salary):person(name,age,sex)
{
strcpy(m_strDept,"电子高专办分室");
m_nSalary=1500;
}
~Teacher()
{
cout<<"deconstructor of Teacher"<<endl;
}
void showMe()
{
cout<<"工作单位:"<<m_strDept<<endl;
cout<<"月薪:"<<m_nSalary<<endl;
}
};
void main()
{
Teacher t1();//"张三",25,'f',"电子高专计算机系",2000);
t1.ShowMe();
}