I want to define an array without a fixed size.
For example: I have an array with numbers (the user will enter these numbers into the array), and I want to divide it into two arrays. But I don't know ahead of time how many numbers the user will enter.
How can I do this?
Use a List<T>
.
Fall back to an ArrayList if generics are not available on your target platform (e.g. .NET Framework 1.1 and lower).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With