Reputation: 827
I have a Queue class that holds a private LinkedList variable. The LinkedList holds DataItem pointers.
class Queue
{
private:
LinkedList* someList;
...
The Queue then tries to add a DataItem using this Add method:
void Queue::addOne(DataItem* data)
{
someList->add(data);
}
It is important to note that the LinkedList class works perfectly.
The program crashes spectacularly when it tries to add something to the Queue. What's going on?
Upvotes: 0
Views: 26
Reputation: 2498
The question is very vague and the code is not representative... maybe you forgot to allocate someList
...?
Upvotes: 2