i actually fail to understand your logic for deletion
q=p->link->link;
p->link=q->link;
q->link=NULL;
free(q);
1> why are you checking for p->link->NUM and not p->NUM directly?
2> when you find it, you assign q to p->link->link and then free(q), shouldn't you be freeing p->link instead?
Last edited by Agni; Jan 14th, 2009 at 4:27 am.
Reputation Points: 431
Solved Threads: 116
Practically a Master Poster
Offline 654 posts
since Dec 2007