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


Please Help Members By Posting Answers For Below Questions

Can u list some style properties of List Box?

581


Is it true that all c# types derive from a common base class?

615


Can you change the value of a constant filed after its declaration?

597


What type of data type conversion happens when the compiler encounters the following code?

633


Why we use get and set property in c#?

607






update data in an xml file which resides in solution itself, using silverlight 4.0

1461


Why do we Need of static class in c#?

721


What is difference between private and protected?

597


Which .gang of four. Design pattern is shown below?

578


What is transparent caching with aop ?

708


How can we make a thread sleep for infinite period ?

628


Can we inherit static class in c#?

560


What is the benefit of using interface in c#?

578


What is the and operator in c#?

587


What are the string functions in c#?

610