It shows undefined reference because the functions showFleet, addcar are not "call by reference " functions.
Arbus
Practically a Master Poster
615 posts since Dec 2010
Reputation Points: 45
Solved Threads: 31
oops sorry, I made a mistake. You cannot have reference to an array. So remove the &.
And also remove it in line 58 and also in lines 202, 204.
addCar(fleet[i]);
So the fleet[] in the main will not be modified by addcar() or any other function.
Arbus
Practically a Master Poster
615 posts since Dec 2010
Reputation Points: 45
Solved Threads: 31
Yes, by doing so you won't get those errors.
Arbus
Practically a Master Poster
615 posts since Dec 2010
Reputation Points: 45
Solved Threads: 31
Nobody in they right mind should write 200+ lines of code before compiling the code. 10-20 lines is more like it with fixed data in code and simple printf instead fancy stuff. BTW (*variable_pointer).record is same as variable_pointer->record and generally thought to be more readable.
You must be sure that you have old functions working, then add one more thing to code and test again. For me 10 times the time of coding for debugging and testing looks about right.
pyTony
pyMod
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852