Click here to Skip to main content
15,074,483 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
my name is frank, I would like to ask a question: can I append two dimensional array to an other array?I tried to get answer on the net but no luck. thank you.

What I have tried:

looked up on the net for solution but nothing satifying.
Updated 4-Mar-21 21:02pm

No. Arrays are not resizable. You would need to create a new array that is big enough to hold all the elements of both source arrays, and copy the elements into it.

You can automate the process somewhat with the Array.Copy Method (System) | Microsoft Docs[^].
WCRYM (we can't read your mind): do both Arrays have the same structure (number of dimensions) ? if not: describe the structure of the result you want to create.

There are several techniques you can use; see: [^], and see Eric Lippert's 2008 article: [^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900