Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

can anyone help me with this code it says that is some thing wrong in this line:

ID: 3646591 • Letter: C

Question

can anyone help me with this code it says that is some thing wrong in this line: " copy = *arrayAddr[i]; "

Thanks !



#include <iostream>
using namespace std;


const int arraynumb = 7; // declaration of keys: number of characters of keys
void copyfunc(int *[], int); // function initialized
int main()
{

int miles[arraynumb] = {15, 22, 16, 18, 27, 23, 20};

copyfunc(miles, arraynumb);

return 0;


}
void copyfunc(int arrayAddr[], int numels)
{

int i, dist[arraynumb];
int copy;

for(i=1; i < arraynumb; i++)
copy = *arrayAddr[i];
dist[i] = copy;
cout << (dist[i]) << endl;

// cout << (dist[i] = *arrayAddr) << endl;

return;
}

Explanation / Answer

copy = *arrayAddr[i]; is right try to right void copyfunc(int arrayAddr[], int numels) as void copyfunc(int* arrayAddr, int numels); it will give you required result surely,