Message-ID: <358DBC89.46A042BB@cs.com> Date: Sun, 21 Jun 1998 22:08:09 -0400 From: "John M. Aldrich" Organization: Two pounds of chaos and a pinch of salt. MIME-Version: 1.0 To: Andrew Deren CC: djgpp AT delorie DOT com Subject: Re: how do I pass more than one value out of a function??? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Andrew Deren wrote: > > Actually I would disagree with that. Pascal var passing is like c++ pass > by reference. Passing a pointer is different than passing a reference. > > (I agree that this is more for comp.lang.c) Actually, your particular point is more for comp.lang.c++, since C doesn't support pass-by-reference. Internally, it's all done via pointers anyway, regardless of the particular language syntax. There is no functional difference between: void addp( int *i1, int i2 ) { *i1 += i2; } and void addr( int &i1, int i2 ) { i1 += i2; } They are identical for all intents and purposes, except that in addp(), the thing i1 points to can be modified. -- --------------------------------------------------------------------- | John M. Aldrich | "Sin lies only in hurting other | | aka Fighteer I | people unnecessarily. All other | | mailto:fighteer AT cs DOT com | 'sins' are invented nonsense." | | http://www.cs.com/fighteer | - Lazarus Long | ---------------------------------------------------------------------