Archived

This topic is now archived and is closed to further replies.

Tiger99

enqueue

Recommended Posts

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; } }

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites