Instead of returning a local array, what I do is create the array in the calling function (main, whatever), and then BRING that array, into the local function that will be working with it, and then there is no need to return it - all the changes you make are saved in the array.

Maybe just my opinion, but that's how C was made to do this, imo. It's ez and very transparent - try it.