From f7aaa7d7f8fd0f8074c85fd530a82639ac7e8642 Mon Sep 17 00:00:00 2001 From: VIliam Date: Thu, 24 Oct 2024 19:02:50 +0200 Subject: [PATCH] 2 --- cv4/a_train.h | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/cv4/a_train.h b/cv4/a_train.h index 7faa267..6ee9e21 100644 --- a/cv4/a_train.h +++ b/cv4/a_train.h @@ -1,7 +1,23 @@ +#include +#include #ifndef TRAIN_H #define TRAIN_H #define SIZE 100 +/** + * Jeden vozen vlaku + */ +struct car { + /** + * Nazov cielovej stanice + */ + char value[SIZE]; + /** + * Smenik na dalsi vozen + */ + struct car* next; +}; + struct car* add_car(struct car* first, const char* target) { // Vytvorenie noveho vozna @@ -29,15 +45,7 @@ struct car* add_car(struct car* first, const char* target) { // Pridanie noveho vozna na koniec temp->next = new_car; return first; -}; - -/** - * Prida vozen na koniec vlaku. - * - * @arg nazov cielovej stanice, ktory sa ma priradit novemu voznu. - * @return smernik na zaciatok vlaku. - */ -struct car* add_car(struct car* first,const char* target); +} /**