Currently I'm having an issue with a homework problem although I'm not asking for the answer. I Just want to see if anyone is able to help me trouble shoot my issue...
Issue:
- ArrayPointer.cpp: In function ‘int* duplicate(int*, int)’:
- ArrayPointer.cpp:62: error: expected `;' before ‘list’
- Line 6
Task:
- I'm trying to write a program that will take numbers from an array and display them and calculate the average.
- Although i do have a separate function that is to duplicate the array and then just display it a second time although the issue is within my duplicate function.
- I'm also utilizing an array as a pointer... I'm not even sure what that is to be honest. I'm guessing it is designating an array that I've created to be used within multiple functions. If you could describe further that would be awesome.
Utilizing:
- Mac OSX
- Compiling in Terminal
// Duplicate Array
int *duplicate(int *list, int count)
{
int *duplicate;
duplicate = new int list[MAX];
for(int i = 0; i < count; i++)
{
duplicate[i] = list[i];
}
return duplicate;
}
Thank you,
CanaznFTW