Content deleted Content added
Epipelagic (talk | contribs) Name move |
m Task 70: Update syntaxhighlight tags - remove use of deprecated <source> tags |
||
Line 39:
== The code fragment is buggy ==
Try a simple thought experiment: <
item = dequeue();</
The front and back pointers are not connected by the queue and dequeue functions, so the sequence won't work as expected.
A possible fixed version of the functions:
<
fifo_node *dequeue(void)
{
Line 66:
}
}
</syntaxhighlight>
Note that this code is twice as long! The whole class would cover a full screen. I'm not sure such a queue implementation would fit into the article...
|