Once you can identify an element of an array, you can retrieve values from it or assign values to it just as you would with any other variable.
To change the value of an array element, we can similarly use the following access forms to assign a value to it:
float anArray[10] = {0.0};
int counter = 9;
float aFloat = 2.5;
anArray[ 9 ] = aFloat;
anArray[ counter ] = getQuarterOf( 10.0 );
anArray[ pow( 3 , 2 ) ] = 5.0 / 2.0;
anArray[ (sizeof(anArray)/sizeof(float) - 1 ] = 2.5;
Each of these array-assignment statements assigns a value (evaluated in various ways) to the last array element, whose index is evaluated in various ways. In each case, the index is evaluated to 9, the index of the last element of the array. The pow()functionraises the first parameter to the power of the second parameter, which in this case is 32, or 9. In each case, the...