Is it possible to make an array of arrays?

Asked

Viewed 42 times

1

In a 3-column datagridview I need to scan all n rows and save them all in an array (or any collection) where each index contains the information for each datagrid row. Something like:

meArray[line1, Linha2, line3, line4,...]

Where each row is stored in another array:

linha1[cellulaColumn 0, cellulaColumn 1, cellulaColumn 2]

Is there any way to do that?

  • Yes, this is called multidimensional array, although it seems from the text you want Jagged array, is there a problem? If that’s all it is, I think it’s duplicate, if it’s more than that, it’s not clear that you need to improve the question. It can reopen if the question is different, but it would need to improve a lot with a specific problem.

  • What you asked for (array array), as @bigown said, is Jagged Arrays. But for tables the multidimensional array is usually better, because in principle a table is a single mass of data distributed in two axes. See the difference in the given question.

  • Right! Thanks, bigown and Bacco. Bacco, but an array array in my case would be easier to manipulate later.

  • @Vinicius really specifics only depend on his real case. I understand that if you are going to retrieve the line to send separately for some other method or function, Jagged can be interesting, despite the slightly higher cost (which is negligible if it is not a gigantic volume of data).

  • @Bacco, yes! There will be a maximum of 10 lines. Thank you very much!!!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.