passing array to calling function

need help in passing an array that was initialized within a function...below is a code snipet. can someone please help. I am successful in creating the array in a function and putting data into it, but need to pass the array back to the calling function.

the size of the array "size" is passed to the function below . thank you in advance for any help

1
2
3
4
5
6
7
8
9
10
11
12
13
  double	getInputs(int size)
	{
		cout << "Please enter " << size <<" double numbers: " <<endl;
		
		int *arr = new int [size];
		
		for (int i = 0; i < size; i ++)
		{
		cout << "Please enter a numbers ==> ";
		cin >> arr[i];
		}
		return    *arr;
		}
Topic archived. No new replies allowed.