(changed name of variable from original question to fit the actual code)
I'm new to C and I'm implementing a queue.
The error is with the `static int head=0` variable. It's incremented by 1 each time dequeue() is called. The error seem to occur when the queue is dequeued and function get\_person() is called. The head-variable is then as it seems getting a high random number, like **23423449**. I have no idea where this comes from. However if I get rid of the "static" keyword so variable is declared as `int head=0`, it works fine. How come?