From 39839475734d6adbe90e14988b530645d7956588 Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Thu, 5 Nov 2020 16:07:56 +0100 Subject: [PATCH] clear --- cv5/a_train.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/cv5/a_train.c b/cv5/a_train.c index 088a647..ccf3980 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -28,7 +28,7 @@ struct car* add_car(struct car* first,const char* target) { void print_train(struct car* first) { for(struct car* this = first; this != NULL; this = this->next){ - printf("%s ", this->value); + printf("%s\n", this->value); } } @@ -82,22 +82,6 @@ struct car* clear_train(struct car* first, const char* target) { } prev = prev->next; } - /* - if(prev->next->next == NULL) { - int x = strcmp(first->value, target); - if(x == 0){ - prev = first->next; - free(first); - return prev; - - } - x = strcmp(prev->next->value, target); - if(x == 0){ - struct car* third = prev->next->next; - free(prev->next); - prev->next = third; - } - } */ return first; }