I'm new to C as well. Sorry if my suggestion turns out to be wrong.
As far as I understand, for a function to return an array it should be declared as returning a pointer to a desired type, in your code to a type int. (e.g int * func(void))
The return statement should be something like (return array). The name of an array is a pointer to the 1st element of an array.
It probably defies the purpose of your task, but you may want to consider the following code:
You may also want to see this link for an answer to how to return arrays from functions.
#define SIZE 3
/* function prototype; ar being a pointer to type int;
* n being array size */
void func(int ar, int n);
int i; /* counter variable */
/* declare an array of 3 ints */
/* call func() to initialise array; pass array name, itself a pointer and
* an array size */
/* print contents of array */
for (i = 0; i < SIZE; i++)
printf("%d ", array[i]);
void func(int ar, int n)
for (i = 0; i < n; i++)
ar[i] = i + 5; /* any other numbers desired */