#include<iostream>
using namespace std;
class Father1{ //基类1
public:
Father1(){
cout<<"这是Father1类的构造函数"<<endl;
}
~Father1(){
cout<<"这是Father1类的析构函数"<<endl;
}
};
int main(){
Father1 *s = new Father1[5];
delete s;
return 0;
}
#include<iostream>
using namespace std;
class P{ //基类1
public:
P(int xx =0):X(xx){}
void f(){
cout<<X;
}
~P(){
cout<<"#";
}
private:
int X;
};
int main(){
P*q1 = new P[3];
P*q2 = new P[3];
q1->f();
delete q1;
q2->f();
delete []q2;
return 0;
}