I am trying to implement a double link list using C++ classes (Don't want to use structure).
I declare the following as class private data:
lList *pNext ; // lList is my list class
lList *pHead; //start of the list
I need to allocate memory to pHead only at the start or if I have to insert something before the head of the list.
When I create the next list instances "phead" is of no use to me. But everytime I create a new list 4 bytes are allocated to the pointer "pHead".
Is there any way I can avoid allocating memory to pHead everytime?
Thanks and Regards,