Multi-dimensional array: Difference between revisions

m
C# changed 2 lines.
m (C# changed the works-with line.)
m (C# changed 2 lines.)
Line 324:
for (int c = array.GetLowerBound(2); c <= array.GetUpperBound(2); c++)
for (int d = array.GetLowerBound(3); d <= array.GetUpperBound(3); d++)
array[a, b, c, d] = n++;
 
//To set the first value, we must now use the lower bounds:
Line 331:
Console.WriteLine("Length: " + array.Length);
Console.WriteLine("First 30 elements:");
//The multidimensional array does not implement the generic IEnumerable<int>,
//just the non-generic IEnumerable, so we need to cast the elements.
Console.WriteLine(string.Join(" ", array.Cast<int>().Take(30)) + " ...");</lang>
{{out}}
196

edits