思维导图
作业2
#include <iostream>
using namespace std;
class Stu
{
string name;
int age;
int score;
int *high;
public:
Stu()
{
name=new char[10];
high=new int();
}
~Stu()
{
delete &name;
delete high;
}
Stu(Stu &a):age(a.age),score(a.score)
{
this->name=new char[10];
this->name=a.name;
this->high=new int (*(a.high));
}
};
int main()
{
Stu *p=new Stu();
delete p;
return 0;
}