Aktualizovat du6/a_station.c
This commit is contained in:
parent
3a6c5a844d
commit
f1e2f5546e
@ -15,10 +15,11 @@ void destroy_station(struct station* station)
|
||||
{
|
||||
return;
|
||||
}
|
||||
struct car* currentTracks = station->tracks;
|
||||
|
||||
for (int i = 0; i < STATION_SIZE, i++)
|
||||
//preiteruje cez kazdy jeden 'track/carar' v poli 'tracks' a pre kazdy jeden track
|
||||
for (int i = 0; i < station->track_count, i++)
|
||||
{
|
||||
struct car* currentTracks = station->tracks;
|
||||
while (currentTracks->next != NULL)
|
||||
{
|
||||
struct car* tempTrack = currentTracks;
|
||||
@ -26,9 +27,16 @@ void destroy_station(struct station* station)
|
||||
free(tempTrack);
|
||||
}
|
||||
}
|
||||
free(station->tracks);
|
||||
free(station);
|
||||
}
|
||||
|
||||
int select_track(struct station* station, const char* target){
|
||||
int select_track(struct station* station, const char* target)
|
||||
{
|
||||
if (station == NULL)
|
||||
{
|
||||
station = (struct station*)calloc(1, sizeof(station));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user