16
Jul

class TestArraysClass

{

static void Main()

{

// Declare a single-dimensional array

int[] array1 = new int[5];

// Declare and set array element values

int[] array2 = new int[] { 1, 3, 5, 7, 9 };

// Alternative syntax

int[] array3 = { 1, 2, 3, 4, 5, 6 };

// Declare a two dimensional array

int[,] multiDimensionalArray1 = new int[2, 3];

// Declare and set array element values

int[,] multiDimensionalArray2 = { { 1, 2, 3 }, { 4, 5, 6 } };

// Declare a jagged array

int[][] jaggedArray = new int[6][];

// Set the values of the first array in the jagged array structure

jaggedArray[0] = new int[4] { 1, 2, 3, 4 };

}

}


Answer:
two dimensional array look like this:

if ur using integer it could be like this:

int grade [0][0];

(suppose ur variable is grade..)

if ur using character :

it could be like this:

name [3][4];

[3]-column 0r row

[4]-row or column

(im not pretty sure)

..ok..


Answer:
int[,] arr1 = new int[4,2];

Array of 4 rows and 2 columns

Book Mark it-> del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Netscape | Yahoo | BlinkList

This entry was posted on Wednesday, July 16th, 2008 at 3:23 pm and is filed under Programming. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or TrackBack URI from your own site.

Leave a reply

Name (*)
Mail (*)
URI
Comment