65,210
社区成员
发帖
与我相关
我的任务
分享#include<iostream>
using namespace std;
class A
{
private:
int *p;
int a,b,c;
public:
A(int,int,int);
~A();
};
A::A(int d,int e,int f)
{
a=d;
p=new int;//--------------------------------------------
b=e;
c=f;
cout<<"call construtor!"<<endl;
}
A::~A()
{
cout<<"call destructor!"<<endl;//运行时就是不显示这一行,,为什么单步调试时候就显示呢。。
delete p;//----------------------------------------------
}
int main()
{
A a(1,2,3);
return 0;
system("pause");
return 0;
}