Jagged Array Dimensions

Posted by Soo on Stack Overflow See other posts from Stack Overflow or by Soo
Published on 2010-05-27T19:45:06Z Indexed on 2010/05/27 19:51 UTC
Read the original article Hit count: 287

Filed under:
|

I'm using jagged arrays and have a bit of a problem (or at least I think I do). The size of these arrays are determined by how many rows are returned in a database, so it is very variable. The only solution I have is to set the dimensions of the array to be very huge, but this seems ... just not the best way to do things.

int[][] hulkSmash = new int[10][];
hulkSmash[0] = new int[2] {1,2};

How can I work with jagged arrays without setting the dimensions, or is this just a fact of life with C# programming??

© Stack Overflow or respective owner

Related posts about c#

Related posts about jagged-arrays