@pagarcia wrote:
Hi,
In this example I'm defining an array
test
as{ {0,1}, {0,1,2} }
ON_SimpleArray<ON_SimpleArray<int>> test; test.Reserve(2); test.SetCount(2); test[0].Reserve(2); test[0].SetCount(2); test[0][0] = 0; test[0][1] = 1; test[1].Reserve(3); test[1].SetCount(3); test[1][0] = 0; test[1][1] = 1; test[1][2] = 2;
When executing this, the arrays
test[0]
andtest[1]
seem to have alwaysCount
at 0. The lines ofReserve
give the crash. Apparently the sizes cannot be increased from 0.What's the proper way to define this? In case this construct turns out to be inefficient, is there a better way to create arrays with arrays as components?
Thanks a lot,
Pablo
Posts: 4
Participants: 3