I subscribe to the philosophy of never giving anything a greater scope than absolutely necessary - it limits these sorts of problems.

As for the function, either reference/pointer arguments or returning a structure would be preferable. It depends on the type of data represented.