You should just pass pointers (since if you pass arrays to a function, what;'s really passed is a pointer anyway). Also, you can't return an array - again, just return a pointer:
int* _addInts(int *x, int *y); // equivalent to: int* _addInts(int x[], int y[]);
You'll also have to arrange for the number of elements to be passed in somehow. Something like the following might work for you:
int* _addInts(int *x, int *y, size_t count);
Also - do not fall into the trap of trying to use sizeof
on array parameters, since they're really pointers in C:
int* _addInts(int x[], int y[])
{
// the following will always print the size of a pointer (probably
// 4 or 8):
printf( "sizeof x: %u, sizeof y: %u\n", sizeof(x), sizeof(y));
}
That's one reason why I'd prefer having the parameters be declared as pointers rather than arrays - because they really will be pointers.
See Is there a standard function in C that would return the length of an array? for a macro that will return the number of elements in an array for actual arrays and will cause a compiler error (on most compilers) much of the time when you try to use it on pointers.
If your compiler is GCC, you can use Linux's trick: Equivalents to MSVC's _countof in other compilers?