If I have the following function...
void function(double *array)
{
double a = array[3]; // Method 1
double b = *(array + 3); // Method 2
}
Assume the array has 5 elements (I do know the length of the array ahead of time). The code compiles fine and runs ok. 'a' and 'b' do contain the expected value.
In what instances would I use method 2 as opposed to method 1?