假设我有以下课程:
class foo{
int array_allocation(int length){
array= new int[length];
return 0;
}
private:
int *array;
};
我应该在这里实现~foo(){ delete []array};
还是隐式完成?
假设我有以下课程:
class foo{
int array_allocation(int length){
array= new int[length];
return 0;
}
private:
int *array;
};
我应该在这里实现~foo(){ delete []array};
还是隐式完成?