Each element of an array is accessed via its basename and an index into the array. An index is also known as a subscript. Each element is accessed using the following form:
arrayName[ index ]
Here, index is a value between 0 and the array size minus 1. We can access any element of an array using this form. Just as with declaring an array, the index may be a literal value, a variable, the result of a function call, or the result of an expression, as follows:
float anArray[10] = {2.0};
int counter = 9;
float aFloat = 0.0;
aFloat = anArray[ 9 ]; // Access last element.
aFloat = anArray[ counter ]; // Access last element via value
// of counter.
aFloat = anArray[ exp( 3 , 2 ) ]; // Access element at result of
// function.
aFloat = anArray[ (sizeof(anArray)/sizeof(float) - 1 ]; // Access
// last element via expression...