Mail Archives: djgpp/1998/06/21/16:00:32
Andrew Deren wrote:
> TO return several values just use:
>
> void foo(int& var1, char& var2, etc...)
>
> and then you call the function with the vars as regular function.
> foo(myInt, myChar);
Most people would suggest you pass pointers. This makes the code easily
understandable and it's obvious what's being potentially modified and
what's not.
References in C++ were added to facilitate operator overloading, and
became a standard part of the language. But under normal circumstances
they should be used exceptionally sparingly (except when passing const
references).
--
Erik Max Francis, &tSftDotIotE / mailto:max AT alcyone DOT com
Alcyone Systems / http://www.alcyone.com/max/
San Jose, California, United States / icbm:+37.20.07/-121.53.38
\
Regret it? nope. / Said it? yep.
/ Ice Cube
- Raw text -