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
This depends massively on your architecture, and also if you expect (or can have) the function inlined. I'd first write the code in the simplest way, and then worry about speed if that shows up as an expensive part of your code.