problem with linklist
- From: sunilsomanna@xxxxxxxxx
- Date: Thu, 05 Jul 2007 08:05:44 -0700
template<class T>
void TimerDLList<T>::addFirst(TimerItem<T>* const itemPtr)
{
// suppose itemPtr is not pointing to NULL
itemPtr->prev = (TimerItem<T>*) NULL;
head = (TimerItem<T>*)NULL;
if (tail == (TimerItem<T>*)NULL ) // nothing in the link list
{
tail = itemPtr;
itemPtr->next = (TimerItem<T>*) NULL;
}
else
{
itemPtr->next = head;
head->prev = itemPtr;
}
head = itemPtr;
}
there seems to be some problem in head->prev = itemPtr.
There seems to be some corrution at this point.
PLEASE HELP.......
seems like head->prev is accessing a wrong address.
.
- Follow-Ups:
- Re: problem with linklist
- From: Martin Ambuhl
- Re: problem with linklist
- From: Jens Thoms Toerring
- Re: problem with linklist
- From: Thomas Lumley
- Re: problem with linklist
- Prev by Date: Re: Does *&s1 refer to the first member of structure variable s1
- Next by Date: Re: Does *&s1 refer to the first member of structure variable s1
- Previous by thread: Does *&s1 refer to the first member of structure variable s1
- Next by thread: Re: problem with linklist
- Index(es):