Some FAQs about PCs you wish you knew before you bought it!

Monday, September 07, 2009

A two-dimensional array stored as a one-dimens...Image via Wikipedia

Q: Is it possible for a function in a programming language to return multiple values?
A:
No. By definition, a "function" in a programming language returns only ONE value. You can "fudge" it by combining the separate values into a "composite" value, such as an array, or a struct/custom type, or such, but it really is returning a single value. You will have to de-couple the values outside the function.

Reblog this post [with Zemanta]