From 11f81e7a80a9eb9668bacf6582443e9d3bbbab79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Vl=C4=8Dek?= Date: Thu, 23 Apr 2026 22:28:45 +0000 Subject: [PATCH] Aktualizovat du6/a_station.c --- du6/a_station.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/du6/a_station.c b/du6/a_station.c index cc8ecc2..15a6e6c 100644 --- a/du6/a_station.c +++ b/du6/a_station.c @@ -27,6 +27,7 @@ void destroy_station(struct station* station) free(tempTrack); } } + //uvolnenie vrchnych prvkov.. free(station->tracks); free(station); } @@ -114,12 +115,13 @@ int count_targets(struct station* station) int count_capacity(struct station* station){ int count = 0; - //preiteruje cez vsetky instancie... + for (int i = 0; i < station->track_count, i++) { struct car* currentTracks = station->tracks[i]; while (currentTracks->next != NULL) { + //skontroluje individualne ich int 'capacity' pole a inkrementuje do vysledneho poctu count += currentTracks->capacity; } }