So I'm building this linked list, with all the adding, and deleting of Nodes done in the Node class themself (managed by a List class). Now I've got the methods working to add and remove elements to the list (in this case a name that's an array of characters), but I can't quite figure out what to write for a loop to check if the string the user types is actually in the list. While the loop I have in the beginning of the method now allows me to type in any name that's not in the list without giving me errors, it now only allows the first non-dummy Node to be deleted. I'm kind of stumped, any suggestions?



Code:
void Node::remove(char n[])    
    {
    if(strcmp(link->name,n)!=0)   // checks to see if character asked to remove exists in the list
        {
        return;
        }    
                
    if (strcmp(link->name,n)==0)
        {
        Node *temp = new Node(n,link);
	    link = link->link;
	    temp->link = NULL;
	    delete temp;
	    temp == NULL;
        }    
        
    else
        link->remove(n);		    
    }