主题:高手指导一下
#include<iostream.h>
class person
{
char * name;
int age;
char *add;
public:
person()
{
cout<<"the constructor of class person!\n";
}
~person()
{
cout<<"the destructor of class person!!\n;
}
};
class student:public person
{char * department;
int level;
public:
student()
{
cout<<"the constructor of class student!\n";
}
~student()
{
cout<<"the destructor of class student!\n";
}
};
class teacher:public person
{
char * amjor;
float salary;
public:
teacher()
{
cout<<"the constructor of class teacher!\n";
~teacher()
{
cout<<"the destructor of class teacher!\n";
}
};
void main()
{
student d1;
student d2;
}
class person
{
char * name;
int age;
char *add;
public:
person()
{
cout<<"the constructor of class person!\n";
}
~person()
{
cout<<"the destructor of class person!!\n;
}
};
class student:public person
{char * department;
int level;
public:
student()
{
cout<<"the constructor of class student!\n";
}
~student()
{
cout<<"the destructor of class student!\n";
}
};
class teacher:public person
{
char * amjor;
float salary;
public:
teacher()
{
cout<<"the constructor of class teacher!\n";
~teacher()
{
cout<<"the destructor of class teacher!\n";
}
};
void main()
{
student d1;
student d2;
}