diff --git a/cv4/a_train.c b/cv4/a_train.c index 3102ea1..46997dc 100644 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -5,14 +5,14 @@ struct car* add_car(struct car* first, const char* target) { - struct car* newcar = (struct car*)calloc(1, sizeof(struct car)); + struct car* newcar = (struct car*)calloc(1, sizeof(struct car)); if (newcar == NULL) { - printf("Ошибка: не удалось выделить память.\n"); + printf("Chyba: nepodarilo sa alokovať pamäť.\n"); exit(1); } - strcpy(newcar->value, target); - newcar->next = NULL; + strcpy(newcar->value, target); + newcar->next = NULL; if (first == NULL) { return newcar; @@ -32,12 +32,12 @@ void print_train(struct car* first) { struct car* current = first; if (current == NULL) { - printf("Поезд пуст.\n"); + printf("Vlak je prázdny.\n"); return; } while (current != NULL) { - printf("%s\n", current->value); + printf("%s\n", current->value); current = current->next; } } @@ -74,7 +74,6 @@ struct car* clear_train(struct car* first, const char* target) { current = current->next; } } - + return first; } -