I do have a function pointer. See the code below. I thought it is unecessary to define the variable as the return value. What can I do to make it better. For example, let the function return itself, which is impossible to my knowledge. For examjple,

return add number

or return (*x + y) something like that

how can I do that

#include <iostream.h>
#include <conio.h>

int *AddNumber(int *x, int *y)
{
int i;
int *z;
const int k=5;

for (i=0;i<k;i++)
{
z[i] = x[i] + y[i];
}

return z;
}

void main()
{
int x[5] = {0,2,4,6,8};
int y[5] = {1,2,3,4,5};
int i, *z;

z = AddNumber(x,y);

for (i=0;i<5;i++)
{
cout<<z[i];
cout<<endl;
}

getch();

}