Hi, I want to create an instance of a list array using an array size of 1000 and the initial capacity of each list that is stored in an array of 500.
I try the following code,
static List<string>[] myList = new List<string>(500)[1000];
this gives me an exception:
Cannot implicitly convert type 'string' to "System.Collections.Generic.List []
but if i just point
static List<string>[] myList = new List<string>[1000];
no problem ... but with that I do not indicate the initial capacity of each list that is stored in the array.
In an array of lists, how to specify the initial capacity of each list stored in the array?
source
share