Fixing counting
This commit is contained in:
parent
39b29d3131
commit
e6d12c5c1c
@ -72,8 +72,17 @@ int count_targets(struct station* station){
|
||||
if(station == NULL || station->tracks == NULL){
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
int total = 0;
|
||||
for(int i = 0; i<station->track_count; i++){
|
||||
struct car* ptr = station->tracks[i];
|
||||
while(ptr){
|
||||
total++;
|
||||
ptr = ptr->next;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
int count_capacity(struct station* station){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user