Answer the question
In order to leave comments, you need to log in
How to increase the size of a 2D string array?
There is a two-dimensional array string t = new string[i, j]; it is required to increase the length of the array j by 1 during the function operation. How can this be done?
Answer the question
In order to leave comments, you need to log in
The correct option is to use List. The
wrong option is to allocate memory for a new array with 1 more element and copy everything element by element.
Even more correct might be to use a list type like Queue or Stack
GavriKos read the source code of IList, List, List
there is an array and goes
If you want this option: Array.Resize<int>(ref t, t.Length + 1);
I did it in my project. Later abandoned in favor of collections with modification.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question