Saving data into array having struct data type

aBuses is an empty array of buses. #undef is telling you there’s nothing in that entry. You should be able to do:

aBuses[1] = Bus(1,2,3,4,5,6,7,8)

And then, since Bus is mutable, you could mutate it later:

aBuses[1].bus_num = 10
2 Likes