jak zniszczyć tablicę
#include <cstdlib>
#include <iostream>
using namespace std;
const unsigned long MAX_SIZE = 20;
typedef int ItemType;
class Heap {
private:
ItemType array[MAX_SIZE];
int elements; //how many elements are in the heap
public:
Heap( )
~Heap( )
bool IsEmpty( ) const
bool IsFull( ) const
Itemtype Retrieve( )
void Insert( const Itemtype& )
};
Powiedzmy, że mam to jako plik nagłówkowy. W mojej implementacji, jaki jest najlepszy sposób na wykonanie konstruktora Heap () i destruktora ~ Heap ().
mam
Heap::Heap()
{
elements = 0;
}
Heap::~Heap()
{
array = NULL;
}
Zastanawiam się, czy jest to właściwy sposób na zniszczenie i skonstruowanie tablicy w tym przypadku.