|
| laxman (1) | |||
| 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..
Any corrections ?? | |||
| toro (2) | |
| 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 {...}. | |
Last edited on | |
| Zhuge (324) | |
| The if statement returns from the function, so that isn't it. I don't see anything that could result in array index problems, but... EDIT: Also, it seems like maybe a map would be better for what you seem to be doing here; let the key be the code. | |
Last edited on | |
| toro (2) | |
| @Zhuge: You are correct. @laxman: Maybe the function is called from different threads? | |
Registered users can post in this forum.
