Saturday, March 6, 2010

How to create Non Zero Base index Array in C#

We can use the following code to create a non zero based index array.

 Array.CreateInstance(typeof(int), new int[] { 10 }, new int[] { 100 });


//Parameters:
1: tells the type of array to create
2: int[] which tell the size of arrays, means we can tell the size of different dimensions of array.
3: int[] which tell the non zero based index of the array.