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?
Agni
Practically a Master Poster
655 posts since Dec 2007
Reputation Points: 431
Solved Threads: 116