From c80a5ff82d2ef7c88273f768e0a28d1e7dc2e2d2 Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Mon, 2 Nov 2020 11:52:40 +0100 Subject: [PATCH] delete --- cv5/a_train.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cv5/a_train.c b/cv5/a_train.c index 41ea869..3f25159 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -32,15 +32,14 @@ void print_train(struct car* first) { } void cancel_train(struct car* first) { - //struct car* this; + struct car* this = first; if(first == NULL){ exit(0); } - if(first->next == NULL){ - //this = first; - //first = first->next; + if(this->next == NULL){ + this = first->next; free(first); - //first = NULL; + this = NULL; } else{ /*struct car* prev = first;