Array in C#


Category: C# Tags: C#

In this question I answered int[2] myArray; but im wrongthe answer is int[,] myArray;The question is Which of these statements correctly declares a two-dimensional array in c#?choices: int[][] myArray; int[,] myArray; int[2] myArray; System.Array[2] myArray;why int[,] myArray is the answer?

Like 1 Person
Asked on 21 February 2014
John Henley Dispo

John Henley Dispo
Atricles: 0
Questions: 3
Given Best Solutions: 2 *

Answers:

Nikhil Joshi
hi john, i think int[][] is a jugged array where you can define columns quantity for every row and int[,] dont have this facility. and int[2] is single dimension array not 2 dimension. see here: http://stackoverflow.com/questions/2072239/initializing-multi-dim-string-arrays/2072254#2072254
Like 0 People on 23 February 2014

You are not loggedin, please login or signup to add comments:

Existing User

Login via:

New User



x