Does C# supports multi-dimensional arrays?
Answer Posted / anand
Yes in addition to single-dimensional arrays, C# supports
the declaration of multidimensional arrays where each
dimension of the array is separated by a comma. Here I'm
declaring a three-dimensional array of doubles: -
double[,,] numbers;
Examples:
currentMonth=10;
sales = new double[2, currentMonth];
for (int i = 0; i < sales.GetLength(0); i++)
{
for (int j=0; j < 10; j++)
{
sales[i,j] = (i * 100) + j;
}
}
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Can a constructor be private in c#?
Is javascript harder than c#?
Does a class need a constructor c#?
Can dictionary have duplicate keys c#?
What is a clr host?
What is the object class in c#?
What are functions c#?
What is object pool in .net?
What is the difference between values and reference types?
You are creating a custom usercontrol, some of the newly created properties are shown in the properties window. How you can hide a new property named theme from the properties window?
What is the difference between ienumerable and enumerator?
What is the difference between the debug class and trace class? Documentation looks the same.
What is sqlcommandbuilder c#?
How can we sort the elements of the array in descending order?
Which controls do not have events?