enqueue

Started by
1 comment, last by Tiger99 21 years, 1 month ago
Hello All I have a enqueue function. When I try to read the data in message struct using a head pointer, it can''t read the data. However, when I use the tail pointer, it works fine Why??? Please help Thanks void timeout_enqueue(MSG_ENV *message) { if(timeout_q.head == NULL) { timeout_q.head = message; timeout_q.tail = message; } else if(timeout_q.head != NULL) { timeout_q.tail->ptr = message; timeout_q.tail = message; } }
Advertisement
That''s a whole lot of info..

If I had to make a hazard quess, you''re not initializing head->ptr but you''re initializing tail->ptr
How can I make sure that I initialized my head and tail?
I thought
timeoutq.head = message
and
timeoutq.tail = message
will take care of that

This topic is closed to new replies.

Advertisement