Managing my array

So I have this template based class which has an array,
queue<T> * items[MAX_HEAP];, and I want to test if the array is empty. How would I do this? I've tried:
1
2
3
4
5
queue<T> *itemsPtr = items[0];

if(itemsPtr->size() != 0){
...
}


but that gives me an run time exception...

Also, how would I point my itemsPtr to the next element in my array?
Last edited on
but that gives me an run time exception...
Has the array been initialized?
Yeah, I do something along the lines of:

1
2
3
4
5
   queue<T> * elementQueue = new queue<T>;

   elementQueue->push(newItem);
   // place the new item at the end of the heap
   items[size] = elementQueue;
Is that size variable, that's used as an index, the correct value?
Topic archived. No new replies allowed.