In this article we will explain what is array in c# or why use array in c# or what are the different
type of array in c#.
Array is a collection/group of variables of same data type. When you need to declare 100 integer or string variables, then you can declare an integer or string array of 100 size. We can access array value by using index position of array. The index position of array are set to zero.
In C#, support two types of array: Single Dimensional Array and Multi Dimensional Array. You can use both type of array easily and can access its value by using loop constructs or index position.
- Integer Array
Declaring and Initializing an Integer Array
int array = new int;
- String Array
Declaring and Initializing an String Array
string array = new string;
array = "B";
array = "C";
array = "D";
I hope this article will help to you.