Could you post the code for the declaration of RacingCar?
nexocentric
Junior Poster in Training
72 posts since Mar 2009
Reputation Points: 26
Solved Threads: 4
Image2->Left += cars[i++]->DistanceTravelled();
Is I always supposed to be 1? Looking through the code you posted, it seems that I will always end up being 1. Is there a value in the vector cars at position 1?
One thing you can do to debug this would be to do the following:
cars[i++]->DistanceTravelled();
if you put this on a line by itself and it still crashes, the error occurs during accessing the vector. If it doesn't, then the error occurs when you try to assign a value to Image2->Left.
nexocentric
Junior Poster in Training
72 posts since Mar 2009
Reputation Points: 26
Solved Threads: 4