Well, you are telling the compiler that you are returning a pointer to an array of 10 elements, so:
Code:
typedef int arrT[10];
arrT* func(int i);
arrT* func(int i)
{
static int arr[10];
return &arr;
}
Btw, you cannot initialize the array with a variable "i". This is not allowed in ISO C++.
If you need to do so, you should use a vector:
Code:
typedef vector<int> arrT;
arrT& func(int i);
arrT& func(int i)
{
static std::vector<int> arr(i);
return arr;
}
But why are you trying to return an array in this manner?