Does anybody know how one goes about having a function that returns a number of values. This is something I have been stuck on for a while and I was wondering if somebody can lead me in the right direction. I thought this could work but had no luck.
I thought int arr is seen as int* arr by the compiler anyway? If so there's no need to create a new array in the function to return a pointer to it since you'll be working with the original array anyway. No need to return anything either. That's if my memory serves. Been a while since I've done something like this.
You are overwriting the memory address stored to out!
Every time you do out = you are assigning a new value to the variable out.
Inside your for loop you are overwriting the value that was originally given by the new operator when you dynamically created an array.
Instead change line 27 cin >> arr[i]; to cin >> out[i]; and remove line 28 out = &arr[i];
Line 32 delete  out; should be removed. This line would never be executed anyways, since it is right after a return statement. What I meant was that somewhere in main you should call delete after you are finished with the array that is returned. I also noticed on line 13 cout << "Values: " << values[i] << endl; you used values[i] and you probably meant show[i], since show is what you call the array returned by NumArray.
@Raezzor: I recommended new because he was creating a new variable that had nothing assigned to it. So to me it seemed like he wanted a brand new array to work with? But I am just assuming... So hopefully the OP will clarify this. It is unnecessary to have a function to have an array passed as a parameter and do nothing with it.
@kevinkjt2000, @Cubbi and @Raezzor, Thanks to all of you.
The idea was to simply have a function that returns a certain amount of values. In hindsight, thanks to you guys, the method that I used was pointless as I ended up not using the array that I placed in my parameter.