Click to See Complete Forum and Search --> : List of List<UInt64>


SoftwareTester
September 19th, 2008, 06:10 AM
I do have

List<UInt64> MyList = new List<UInt64>();


But how do I create a List for adding several 'MyList's ?

torrud
September 19th, 2008, 06:19 AM
Try this:

public class MyList: List<UInt64>
{}


List<MyList> myLists = new List<MyList>();

Mutant_Fruit
September 19th, 2008, 06:58 AM
Or you can avoid creating a new class and just do:

List<List<uint>> listoflists = new List<List<uin>>();

dahwan
September 19th, 2008, 08:15 AM
Why don't you use two-dimensional arrays? They work about the same way.


uint[,] MyList = new MyList[10, 10];


That list would have 10 rows with 10 uints in each. The down-part is that you have to specify the number of values at creation.

boudino
September 19th, 2008, 09:04 AM
Why not? Becase array and collection are two different things.

SoftwareTester
September 20th, 2008, 01:46 AM
Why don't you use two-dimensional arrays? They work about the same way.


uint[,] MyList = new MyList[10, 10];


That list would have 10 rows with 10 uints in each. The down-part is that you have to specify the number of values at creation.

Because i don't know the size of collection and it can (will) grow I can't use a fixed arraysize but must use a 'growable' collection