EDIT: I figured it out. I do not know how to delete threads. Sorry.
I need to return a pointer to a new array. The new array must be the same as the old one, just in reverse. I have it all done except for one little part. I can't seem to return the the pointer to show all the elements. I get 50, after that is all a bunch of random numbers being printed out. Any quick fixes in order for it to print out 50 40 30 20 10. Thanks
#include <iostream>
using namespace std;
int *reverseArray(int array1[], int const size);
int main() {//start main
const int size = 5;
int array1 [size] = {10,20,30,40,50};
int *newArray;
int count;
int x;
newArray = reverseArray(array1, size);
for (count = 0; count < size; count ++){//start for
cout << newArray[count];
}//end for
cin >> x;
}//end main
int *reverseArray(int array1[], int const size) {//start function
int count;
int i=0;
int newArray[5];
int *numptr = newArray;
cout << "This is the orginal array: " ;
for(count = 0; count < size; count++){//start for
cout << array1[count] << " ";
}//end for
while (count > 0 ) {//start while
numptr[i] = array1[count -1];
cout << numptr[i];
count--;
i++;
}//end while
return numptr;
}// end function