clear
This commit is contained in:
parent
194849ce29
commit
b6d8ebbf3c
@ -1,5 +1,4 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@ -78,10 +77,9 @@ struct car* clear_train(struct car* first, const char* target) {
|
||||
while(this != NULL){
|
||||
int x = strcmp(this->value, target);
|
||||
if(x == 0){
|
||||
this->value = this->next->value;
|
||||
struct car* third = this->next;
|
||||
this->next = third->next;
|
||||
free(third);
|
||||
struct car* temp = this->next;
|
||||
this->value = temp->value;
|
||||
free(temp);
|
||||
return 0;
|
||||
}
|
||||
this = this->next;
|
||||
|
Loading…
Reference in New Issue
Block a user