From af3d09e2ef9a691f35fb627612b9a481a2ae31d2 Mon Sep 17 00:00:00 2001 From: vj586da Date: Thu, 4 Nov 2021 21:05:56 +0100 Subject: [PATCH] final3? --- cv4/a_train.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cv4/a_train.c b/cv4/a_train.c index f5fa973..1f4cbed 100755 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -73,6 +73,11 @@ struct car* clear_train(struct car* first, const char* target) { else { this = this->next; } + } + if(strcmp(this->next->value,target) == 0{ + free(this->next); + this->next=NULL; + return this; } return first; }