[SOLVED] Array of TVectorDs inside for loop cause crash

Thanks Rene, you solved my problem :slight_smile:

When you ask whether it works in interpreted mode (till now I was running it in g++ and ACLic mode), Cint shown “array index out of range”. In fact, declaration of array in line #38 has second dimension to low: 0x1f instead of 0x20. After this fix everything works fine, also problem from this topic: [SOLVED] Strange behavior of array of doubles

Explanation is easy, when program writes to last three elements of array it overwrites some memory owned by TVectorD array, and after this program crash, when destructor for TVectorD is call.

The same was for array of doubles. Now I found that corrupted values found in first three elements of array match to values from fitting (stored in another array with index out of range).

Thanks again and all the best,
Rafal