you need to keep two different pointers for curr because you have two different loops. Try this:
curr1 = head;
while(curr1)
{
strcpy(check,curr1->word);
curr2 = curr1->next;
while(curr2)
{
if(strcmp(check,curr2->word)==0)
printf("duplicate"); {here should come the remove node function}
curr2 = curr2->next;
}
cur1 = cur1->next;
}
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953