Here and the questions and my answers:
1.) Print the elements of array values using pointer/offset notation.
ANS: for ( i = 0; i < SIZE; i++ )
printf("%.1f", values);
2.) Print the elements of array values by subscripting the pointer to the array.
ANS: for ( i = 0; i < SIZE; i++ )
printf("%.1f", values[ i ] );
3.) Refer to element 5 of array values using array subscript notation, pointer/offset notation with the array name as the pointer, pointer subscript notation and pointer/offset notation.
ANS: values[ 5 ]
*( values + 5 )
values[ 5 ]
*( values + 5 )
4.) What address is referenced by vPtr + 3? What value is stored at that location?
ANS: The address is 1002500 + 3 * 4 = 1002512. The value is 3.3
5.) Assuming vPtr points to values[ 4 ], what address is referenced by vPtr -= 4. What value is stored at that location?
ANS: The address of values[ 4 ] is 1002500 + 4 * 4 = 1002516
The address of vPtr -= 4 is 1002520 - 4 * 4 = 1002504
The value of that location is l.1
how'd I do?
thanks