From a66b22631d4b77e8c64e3a5d8c8b965facedb463 Mon Sep 17 00:00:00 2001 From: vj586da Date: Thu, 4 Nov 2021 20:42:32 +0100 Subject: [PATCH] zly return --- cv4/a_train.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cv4/a_train.c b/cv4/a_train.c index 5d61b3f..06f53de 100755 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -61,5 +61,12 @@ struct car* clear_train(struct car* first, const char* target) { this = this->next; } } - return first; + if(strcmp(this->value, target) ==0){ + free(this); + this->next = NULL; + return this; + } + else{ + return first; + } }