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;
}
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Offline 21,953 posts
since Aug 2005