From 67305af8915d3a33939ba6135303e1fdb80b43b9 Mon Sep 17 00:00:00 2001 From: Bohdan Kapliuk Date: Tue, 15 Oct 2024 14:38:26 +0300 Subject: [PATCH] 123 --- cv4/a_train.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cv4/a_train.c b/cv4/a_train.c index 8f276b8..6a76c4e 100644 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -1,5 +1,7 @@ #include "a_train.h" #include +#include +#include struct car* add_car(struct car* first,const char* target) { struct car* newcar = calloc(1,sizeof(struct car)); @@ -13,10 +15,10 @@ struct car* add_car(struct car* first,const char* target) { } void print_train(struct car* first) { - while(first != NULL)( + while(first != NULL){ printf("%s", first->value); - first->value = first->next - ) + first = first->next; + } } void cancel_train(struct car* first) {