|
-
September 19th, 2008, 06:10 AM
#1
List of List<UInt64>
I do have
Code:
List<UInt64> MyList = new List<UInt64>();
But how do I create a List for adding several 'MyList's ?
-
September 19th, 2008, 06:19 AM
#2
Re: List of List<UInt64>
Try this:
Code:
public class MyList: List<UInt64>
{}
List<MyList> myLists = new List<MyList>();
Useful or not? Rate my posting. Thanks.
-
September 19th, 2008, 06:58 AM
#3
Re: List of List<UInt64>
Or you can avoid creating a new class and just do:
List<List<uint>> listoflists = new List<List<uin>>();
www.monotorrent.com For all your .NET bittorrent needs
NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
-
September 19th, 2008, 08:15 AM
#4
Re: List of List<UInt64>
Why don't you use two-dimensional arrays? They work about the same way.
Code:
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.
Please vote the posts you find usefull.
---
I'm back
Bigger and badder
Better and bolder
Explaining stuff -
With an improved vocabulary!
-
September 19th, 2008, 09:04 AM
#5
Re: List of List<UInt64>
Why not? Becase array and collection are two different things.
- Make it run.
- Make it right.
- Make it fast.
Don't hesitate to rate my post. 
-
September 20th, 2008, 01:46 AM
#6
Re: List of List<UInt64>
 Originally Posted by dahwan
Why don't you use two-dimensional arrays? They work about the same way.
Code:
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|