This tutorial is about arrays in C#. An array is a collection of values of the same data type

Don't forget to check out our site http://howtech.tv/ for more free how-to videos!
http://youtube.com/ithowtovids - our feed
http://www.facebook.com/howtechtv - join us on facebook
https://plus.google.com/103440382717658277879 - our group in Google+

Introduction
An array in C# is a collection of values of the same data type. You can create arrays that can store more than one value. Array elements are accessed by using a single name and an index number representing the position of the element within the array. Array is a reference data type. The following figure shows the array structure in the system's memory.

Step 1: Initialization
An array in C# needs to be declared and initialized before it can be used in a program. The following code snippet is an example of array initialization:
int[] score = new int[10];

Step 2: Assignment
You can assign values to each element of the array by using the index number, which is also called the array subscript of the element.
score[0] = 5;

You can assign values to an array at the time of initialization as well. In this case, you cannot specify the size of the array.
int[] score = { 5, 10, 15 };
The compiler implicitly initializes each array element to a default value depending on the array type.
Other ways of initializing an array:
int[] score = new int[3] {5, 10, 15};
int[] scorer = new int[] {5, 10, 15};

Step 3: Iteration
To iterate through the array in C#, you can use any looping construct but the foreach statement interprets the common looping process by removing the need to check the array size.
The following code snippet accesses the score, one after another:
foreach(int i in score)
{
Console.Write("\t"+i);
}


Conclusion
The compiler implicitly initializes each array element to a default value depending on the array type. It can be an character, string or double. The array class is the base class for all the arrays in C#. It is under the namespace System. There are various properties and methods de