I did try the free(q), but was surprised when the following thing happened:
when there were still items on my queue, i did a free(q) and then tried to access items on my queue, it turns out that the first remaining item was not accessible but the 2nd, 3rd item so on were accessible. any explanation for this?
Once you've freed it, consider all of it inaccessible. If it appears that items are still accessible, that's just a temporary illusion to make you think you're doing something you're allowed to.
Reputation Points: 2780
Solved Threads: 312
long time no c
Offline 4,790 posts
since Apr 2004