I need help in the Syntax of this

My advice is to pass the array by reference, like this:

Yep. Functions can not return arrays.