But its more complicated, ill try to explain what im doing the best I can. I would post all the code but it would be way to many files.
I have multi dimensional array of objects declared like:
Expand|Select|Wrap|Line Numbers
- Target targets[10][100];
Expand|Select|Wrap|Line Numbers
- Target* lastDetected;
Each column in the targets array (theres 10 of them) refers to frame or time t. So after each loop the columns are copied like so: 0->1->2...8->9. Each node or Target object is copied individually. Code that does that is:
Expand|Select|Wrap|Line Numbers
- for (int i = 10- 1; i > 0; i--) {
- for (int j = 0; j < 100; j++) {
- targets[i][j] = targets[i - 1][j];
- }
- }
Well else where in the code the next or lastDetected variable in each object in column 0 is set to another Target object in column 1 of the list of all targets.
However when I try to run in the Target object class. It only works correctly for one time then it goes into an infinite loop.
Expand|Select|Wrap|Line Numbers
- Target *nTarget = this;
- while(nTarget->lastDetected != NULL)
- printf("->%d",nTarget->id);
- nTarget = nTarget->lastDetected;
- }
Any Thoughts?