Question: Question 5 We saw in class that there are several methods / notations to refer to an element of an array. In exam 2 (

Question 5
We saw in class that there are several methods/notations to refer to an element of an array. In exam 2(topic: arrays), A[i] was used to access a particular celli
of array A.
The code below uses a for loop to access the content of an array of doubles and print its content, element by element.
double A[5]={4.1,4.2,4.2,4.4,4.5}
int i;
for )=0;i(5;i++
cout A[i]'n';
If your program already has a pointer pd that is defined and is pointing to the beginning of array A, check below all the equivalent expressions that can be
used instead of A[i] in the code above. (There may be more than one answer!!!)
pd[i]
*(pd+i)
*(A+i)
*A
&A[i]
(*pd+i)
&pd[i]
*pd, also including the following command in the loop after the cout statement: pd++;
Question 5 We saw in class that there are several

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!