To assign specific value to 1D array I\'m using LINQ like so:
int[] nums = new int[20];
nums = (from i in nums select 1).ToArray()
One way you could do this is like so:
// Define a little function that just returns an IEnumerable with the given value
static IEnumerable Fill(int value)
{
while (true) yield return value;
}
// Start with a 1 dimensional array and then for each element create a new array 10 long with the value of 2 in
var ar = new int[20].Select(a => Fill(2).Take(10).ToArray()).ToArray();