In C#, all arrays are zero based. If you declare an array as
int x = new int;
such arrays have 10 elements, numbered from 0 to 9. Thus, arrays are in line with the style used in C, C++ and Java.
const int MAX = 10;
float xy = new float[MAX];
for (int i = 0; i < MAX; i++ )
xy[i] = i;
You should get into the habit of looping through arrays to the array bounds minus one as we did in the above example.
All array variables have a length property so you can find out how large the array is:
float z = new float;
for (int j = 0; j< z.Length ; j++)
z[j] = j;
Arrays in C# are dynamic and space can be reallocated at any time. To create a reference to an array and allocate it later within the class, use the syntax:
float z; //declare here
z = new float; //create later