How do i create an array of unequal length arrays?

Posted by Faken on Stack Overflow See other posts from Stack Overflow or by Faken
Published on 2010-01-05T11:50:56Z Indexed on 2010/03/23 3:11 UTC
Read the original article Hit count: 343

Filed under:
|

Hello everyone,

I need to create a sort of 2D array in which each one of the secondary arrays are of different length. I have a 1D array of known length (which defines the number of arrays to be formed) with each element having a number that denotes the length of the secondary array in that position.

Each one of the arrays are fairly large so i don't want to create a one-size-fits-all "fake" 2D heap array to cover everything.

How would i go about doing this? Any 2D array I have made before are always rectangular.

I'm trying to do this so that i can create some code to dynamically generate threads to split up some workload.

Thanks,

-Faken

© Stack Overflow or respective owner

Related posts about visual-c++

Related posts about arrays