I'm trying to go search through my linked list for a passed string and if it matches, remove it...but obviously link everything back together properly. This is what I have so far but when i pass it to my display function, which is properly working, it goes into an endless loop. Any pointers greatly appreciated
Code:void llRemoveString(LinkedList** ll, char* string) { LinkedList* newNode = (LinkedList*)malloc(sizeof(LinkedList)); newNode->value = string; LinkedList* n = *ll; while(n->next != NULL) { n = n->next; if(n->next->value == newNode->value){ newNode->next = n->next; n->next = newNode; } } }