I am tring to intialize an array of pointers to a NODE struct that I made
struct Node{
int data;
Node* next;
};
the private member of my other class is declared as
Node** buckets;
It is currently initialised as buckets = new Node*[SIZE]
Is there anyway to initialize the array so that its members point to NULL or some other predefined Node pointer?
EDIT: Im looking for a means to initilize it without trying to generate a for loop to traverse through the full lenght of the array. The size of the array is determined at runtime.
EDIT 2: I tried std::fill_n(buckets, SIZE_OF_BUCKET, NULL); but the compiler gives the error "cannot convert from 'const int' to 'Node *'" I am using visual studio 2008. Is there something wrong that I am doing?