class DArray
{
public:
DArray() : data(NULL)
{
}
DArray(int length)
{
data = new int[length];
memset(data, '\0', sizeof(int));
}
~DArray()
{
if (data)
{
delete data;
data = NULL;
}
}
DArray operator=(DArray& a)
{
this->data = a.data;
return *this;
}
private:
int* data;
};
看看符合不符合要求。
温馨提示:答案为网友推荐,仅供参考