clear
This commit is contained in:
parent
727845e0c9
commit
194849ce29
@ -78,10 +78,11 @@ struct car* clear_train(struct car* first, const char* target) {
|
|||||||
while(this != NULL){
|
while(this != NULL){
|
||||||
int x = strcmp(this->value, target);
|
int x = strcmp(this->value, target);
|
||||||
if(x == 0){
|
if(x == 0){
|
||||||
struct car *third = this->next;
|
this->value = this->next->value;
|
||||||
|
struct car* third = this->next;
|
||||||
this->next = third->next;
|
this->next = third->next;
|
||||||
free(third);
|
free(third);
|
||||||
return first;
|
return 0;
|
||||||
}
|
}
|
||||||
this = this->next;
|
this = this->next;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user