My C is rusty... I need to review pointer/address-of syntax. The idea for the 3rd argument was to show one "passed by reference"; in any case modifiable by the subroutine.
But where did x and y come from? sas On Sun, Mar 26, 2023 at 7:53 PM Frank Swarbrick <[email protected]> wrote: > Also, "*k = x + y". > ________________________________ > From: IBM Mainframe Discussion List <[email protected]> on behalf > of Frank Swarbrick <[email protected]> > Sent: Sunday, March 26, 2023 5:52 PM > To: [email protected] <[email protected]> > Subject: Re: ASM call by value > > I'm guessing he meant "int *k" rather than "&int k". > > ________________________________ > From: IBM Mainframe Discussion List <[email protected]> on behalf > of Paul Gilmartin <[email protected]> > Sent: Sunday, March 26, 2023 5:49 PM > To: [email protected] <[email protected]> > Subject: Re: ASM call by value > > On Sun, 26 Mar 2023 19:35:59 -0400, Steve Smith wrote: > > >I forgot to mention, to pass by value with CALL, you need [a] register[s]. > >e.g.: > >void foo(int i, int j , &int k) > > { > > k = i + j; > > } > > > That shouldn't be legal. In fact, gcc gives me: > cc tinyc.c -o tinyc > tinyc.c:3:25: error: expected parameter declarator > void foo(int i, int j , &int k) > > -- > gil > > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
