I want to create an array whose number of stored values increases by one every time a button is clicked. So I need a way to change the number of array elements during run-time.
Asked
Active
Viewed 348 times
1 Answers
1
You can use the Array.resize()
method.
Documentation can be found here: https://learn.microsoft.com/en-us/dotnet/api/system.array.resize?view=netframework-4.7.2
Array.Resize doesn't resize the array, it creates a new array with the specified size and copies all the elements from the old array to the newly created array and then replaces the old array with the new array however this would be suitable for you based on your question.

Sam79
- 36
- 2