C# list of list? -


If I have this:

  list & lt; List & lt; Int & gt; & Gt; Matrix = new list & lt; List & lt; Int & gt; & Gt; ();  

How do I populate it, something looks like this:

 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

  list & lt; List & lt; Int & gt; & Gt; Matrix = new list & lt; List & lt; Int & gt; & Gt; (New [] {New list & lt; int & gt; (new [] {0, 0, 0, 0}), New list & lt; int & gt; (New [] [0, 0 , 0, 0, 0, 0}), new list & lt; int & gt; (new [] {0, 0, 0, 0}}});  
< Hr>

Ernys L. Here ...

Just wanted to use that collection initiator (if Net 3.0 is supported):

  var matrix = new List & lt; List & lt; int & gt; & gt; {New list & lt; int & gt; {0, 0, 0, 0}, New list & lt; int & gt; {0 , 0, 0, 0, 0, 0, 0}, New list & lt; int & gt; {0, 0, 0, 0,}};  

Comments