I need to write a function that accepts int array and array's size as arguments. Then the function should create a copy of the array, except that the element values is in reverse in the copy. The function should return a pointer to the new array.
I am having a slight problem. I get this error, Error 1 error C2664: 'reverseArray' : cannot convert parameter 1 from 'int [5]' to 'int' and I don't know what I've done wrong. Any help will be much appreciated
#include <iostream>
using namespace std;
int reverseArray(int, int, int *);
int main() {//start main
const int size = 5;
int array1 [size] = {10,20,30,40,50};
int newArray [size];
int* numptr = array1;
reverseArray(array1, size, numptr);
}//end main
int reverseArray(int array1[], int size, int *numptr) {//start function
int count;
cout << "This is the orginal array: " ;
while (numptr < &array1[4]) {//start while
cout << *numptr << " ";
numptr ++;
}//end while
return 0;
;}// end function