How to define an array without a fixed size?

I want to define an array without a fixed size.

For example: I have an array with numbers (the user enters these numbers into an array), and I want to split it into two arrays. But I do not know in advance how many numbers the user enters.

How can i do this?

+4
source share
1 answer

Use List<T> .

Return to ArrayList if generics are not available on the target platform (e.g. .NET Framework 1.1 and below).

+12
source

Source: https://habr.com/ru/post/1333548/


All Articles