#include
#include
using namespace std;
class phone
{
public:
phone()
{}
phone(string name)
{
p_name = name;
cout << "phone有参构造" << endl;
}
~phone()
{
cout << "phone的析构函数" << endl;
}
string p_name;
};
class student
{
public:
student(string m_name, int m_score, int m_high, string p_name):name(m_name),score(m_score),high(new int(m_high)),pname(m_name){}
~student()
{
cout << "student的析构函数" << endl;
}
void pnames()
{
cout << name << "拿着" << pname.p_name << "手机" << endl;
}
public:
string name;
int score;
int* high;
phone pname;
};
int main()
{
student s;
}