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; } }