Important: Please see this very much related question: Return multiple values in C++.
I\'m after how to do the same thing in ANSI C? Would you use a
Keep in mind that sometimes is faster to pass parameters by value and update on return (or make local copies on the stack) than by reference... This is very evident with small structures or few parameters and lots of accesses.