I find the concepts in pointers to an array very confusing in the context of using them in functions.
Here in this case I am trying to get a whole array from a function. The whole array is generated within the function. Obviously my code is hopelessly nonsensical.
#include <iostream>
using namespace std;
void func(int &array);
int main()
{
func(&array);
cout << array[1];
cin.get();
return 0;
}
void func(int &array)
{
int array[] = {10,20,30,40};
}