I blame MSDN
[COLOR=blue]class[/COLOR] TestArraysClass
{
[COLOR=blue]static[/COLOR] [COLOR=blue]void[/COLOR] Main()
{
[COLOR=green]// Declare a single-dimensional array [/COLOR]
[COLOR=blue]int[/COLOR][] array1 = [COLOR=blue]new[/COLOR] [COLOR=blue]int[/COLOR][5];
[COLOR=green]// Declare and set array element values[/COLOR]
[COLOR=blue]int[/COLOR][] array2 = [COLOR=blue]new[/COLOR] [COLOR=blue]int[/COLOR][] { 1, 3, 5, 7, 9 };
[COLOR=green]// Alternative syntax[/COLOR]
[COLOR=blue]int[/COLOR][] array3 = { 1, 2, 3, 4, 5, 6 };
[COLOR=green]// Declare a two dimensional array[/COLOR]
[COLOR=blue]int[/COLOR][,] multiDimensionalArray1 = [COLOR=blue]new[/COLOR] [COLOR=blue]int[/COLOR][2, 3];
[COLOR=green]// Declare and set array element values[/COLOR]
[COLOR=blue]int[/COLOR][,] multiDimensionalArray2 = { { 1, 2, 3 }, { 4, 5, 6 } };
[COLOR=green]// Declare a jagged array[/COLOR]
[COLOR=blue]int[/COLOR][][] jaggedArray = [COLOR=blue]new[/COLOR] [COLOR=blue]int[/COLOR][6][];
[COLOR=green]// Set the values of the first array in the jagged array structure[/COLOR]
jaggedArray[0] = [COLOR=blue]new[/COLOR] [COLOR=blue]int[/COLOR][4] { 1, 2, 3, 4 };
}
}
http://msdn2.microsoft.com/en- ... rary/9b9dty7d(VS.80).aspx
