Hi,
I was implementing queue in some pre-written program.
There I get this heap corruption error. I predict the error might be
of array index overflow..
If (rear >= MAX_LIST) and there is no element with that code in the list, the last lines are executed.
Possible solution: put the second part of the code in a else {...}.