How i can fix this code? i need to cancel a node and return next node with 2 equal string?
NodePtr cancWord(NodePtr head, char *vett){
if(!head)
return NULL;
if(strcmp(head->word,vett)==0){
NodePtr tmp = head;
head = head->next;
free(tmp->word);
free(tmp);
return head;
}
head->next = cancWord(head->next,vett);
return head;
}
New contributor
Giovane 4 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1