du4.2
This commit is contained in:
parent
be3d77502c
commit
b9d90d148d
@ -31,11 +31,15 @@ void print_train(struct car* first) {
|
||||
}
|
||||
|
||||
void cancel_train(struct car* first) {
|
||||
if (first == NULL) return;
|
||||
cancel_train(first->next);
|
||||
while (first) {
|
||||
struct car* next = first->next;
|
||||
first->next = NULL; // ochrana proti cyklom alebo neplatnému next
|
||||
free(first);
|
||||
first = next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct car* clear_train(struct car* first, const char* name) {
|
||||
|
||||
// Ak je zoznam prázdny
|
||||
|
||||
Loading…
Reference in New Issue
Block a user