From b092ab2b215521b4f58f30f218e28f62ce26957b Mon Sep 17 00:00:00 2001 From: Viktor Daniv Date: Wed, 6 Nov 2024 11:16:09 +0000 Subject: [PATCH] Update cv6/a_station.c --- cv6/a_station.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cv6/a_station.c b/cv6/a_station.c index d0e7f97..6a1ebff 100644 --- a/cv6/a_station.c +++ b/cv6/a_station.c @@ -2,6 +2,18 @@ #include #include + +struct car { + char target[50]; // Cíl trati, řetězec + int capacity; // Kapacita trati +}; + +struct station { + struct car** tracks; // Pole ukazatelů na `car` (jednotlivé tratě) + int track_count; // Počet tratí +}; + + struct station* create_station() { struct station* station = (struct station*)calloc(1, sizeof(struct station)); station->tracks = (struct car**)calloc(STATION_SIZE, sizeof(struct car*));