Download - Microsoft C Sharp, Array Explained in Detail
![Page 1: Microsoft C Sharp, Array Explained in Detail](https://reader037.vdocuments.us/reader037/viewer/2022100517/55725c26497959da6be8b93d/html5/thumbnails/1.jpg)
An array index starts at zero. That means first item of an array will be stored at 0th
position and the position of last item of an array will be total number of items - 1.
![Page 2: Microsoft C Sharp, Array Explained in Detail](https://reader037.vdocuments.us/reader037/viewer/2022100517/55725c26497959da6be8b93d/html5/thumbnails/2.jpg)
In C#, arrays can be declared as fixed length or dynamic.
Fixed length array can store a predefined number of items, while size of dynamic arrays
increases as you add new items to the array.
![Page 3: Microsoft C Sharp, Array Explained in Detail](https://reader037.vdocuments.us/reader037/viewer/2022100517/55725c26497959da6be8b93d/html5/thumbnails/3.jpg)
Types of Arrays
-Single Dimensional Arrays
-Two Dimensional Arrays
-Jagged Arrays
![Page 4: Microsoft C Sharp, Array Explained in Detail](https://reader037.vdocuments.us/reader037/viewer/2022100517/55725c26497959da6be8b93d/html5/thumbnails/4.jpg)
One Dimensional Arrays:<type>[] <name>=new <type>[size];
int[] arr=new int[4];or
int[] arr;arr=new int[5];
orint[] arr={list of values};
![Page 5: Microsoft C Sharp, Array Explained in Detail](https://reader037.vdocuments.us/reader037/viewer/2022100517/55725c26497959da6be8b93d/html5/thumbnails/5.jpg)
Two Dimensional Arrays : <type>[,] <name>=new <type>[rows, cols];
int[,] arr=new int[3, 4];or
int[,] arr;arr=new int[2, 3];
orint[,] arr={list of values};
![Page 6: Microsoft C Sharp, Array Explained in Detail](https://reader037.vdocuments.us/reader037/viewer/2022100517/55725c26497959da6be8b93d/html5/thumbnails/6.jpg)
Jagged Arrays :<type>[][] <name>=new <type>[rows][];
int[][] arr=new int[3][];or
int[][] arr={list of values};