comp.lang.ada
 help / color / mirror / Atom feed
From: "David Botton" <David@Botton.com>
Subject: Re: Ada Core Technologies announces GNATCOM
Date: 2000/04/12
Date: 2000-04-12T00:00:00+00:00	[thread overview]
Message-ID: <xi4J4.2$eF.226@news-east.usenetserver.com> (raw)
In-Reply-To: 8d2d8j$1tk$1@nnrp1.deja.com

I am not sure I understand how I am confused, although I may very well be.

In the Turbo C version I used (some many years ago) if struct q was large
enough doing

m.a++ in the function as you do below would in fact change the m passed in,
ie. a pass by reference.

ex.

struct q z;
z.a = 5;

clobber (z);

z.a now equals 6 (providing of course that size(q) past the compiler limit
for passing by value/copy).

I even remember a "pragma" that let me play with the minimum size for pass
by copy instead of pass by reference.

Am I missing something? (most likely. If you can explain it to me, it would
be helpful.)

David Botton



>  int clobber (struct q m) {
>      m.a++;
>      return m.a;
>  }
>
>called in c passing a value of the struct type does NOT change
>the value of the passed variable.







  reply	other threads:[~2000-04-12  0:00 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-07  0:00 Ada Core Technologies announces GNATCOM Robert Dewar
2000-04-07  0:00 ` Ted Dennison
2000-04-07  0:00 ` Vladimir Olensky
2000-04-08  0:00   ` Robert Dewar
2000-04-08  0:00 ` tmoran
2000-04-08  0:00   ` Robert Dewar
2000-04-09  0:00     ` tmoran
2000-04-09  0:00       ` Larry Kilgallen
2000-04-09  0:00         ` tmoran
2000-04-09  0:00         ` Robert Dewar
2000-04-09  0:00         ` Robert Dewar
2000-04-09  0:00         ` Marin D. Condic
2000-04-09  0:00           ` Brian Rogoff
2000-04-09  0:00             ` David Starner
2000-04-10  0:00               ` Gisle S�lensminde
2000-04-10  0:00                 ` Hyman Rosen
2000-04-11  0:00                   ` Gisle S�lensminde
2000-04-11  0:00                     ` Hyman Rosen
2000-04-10  0:00             ` Marin D. Condic
2000-04-11  0:00         ` Tucker Taft
2000-04-09  0:00       ` Robert Dewar
2000-04-09  0:00     ` tmoran
2000-04-12  0:00       ` Robert Dewar
2000-04-12  0:00         ` Tarjei T. Jensen
2000-04-12  0:00           ` David Botton
2000-04-12  0:00             ` Robert Dewar
2000-04-12  0:00               ` David Botton [this message]
2000-04-12  0:00                 ` Hyman Rosen
2000-04-12  0:00                   ` David Botton
2000-04-13  0:00                     ` Robert Dewar
2000-04-14  0:00                       ` Geoff Bull
2000-04-14  0:00                         ` dale
2000-04-13  0:00                     ` Tarjei T. Jensen
2000-04-13  0:00                 ` Robert Dewar
2000-04-12  0:00               ` DuckE
2000-04-13  0:00                 ` Robert Dewar
2000-04-12  0:00           ` Robert Dewar
2000-04-12  0:00             ` Robert A Duff
2000-04-13  0:00               ` Robert Dewar
2000-04-13  0:00                 ` Robert A Duff
2000-04-15  0:00                   ` Robert Dewar
2000-04-12  0:00         ` C_Pass_By_Value, was " tmoran
2000-04-08  0:00   ` David Botton
2000-04-08  0:00 ` Tom Hargraves
2000-04-08  0:00   ` David
2000-04-08  0:00   ` Robert Dewar
2000-04-08  0:00   ` David Starner
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox