Am 03.04.2023 um 00:37 schrieb Frank Swarbrick:
Something to note, and it's not supported by C as far as I am aware, is neither of these are 
"pass by content".  Pass by content is "pass address of a copy of the field".  
So a copy is done, as with fun2, but the parameter list pointed to by R1 is not the address of the 
copied fields but rather the address of a parameter list that contains the addresses of both copied 
fields.

C only supports call by value;
if you want other things like call by reference or "call by content", as defined by COBOL,
you have do simulate them by passing pointers by value explicitly
(and in the case of call by content, by copying the parameters before passing their addresses).

C is a very small language - the C designers IMO believed that call by value is sufficient, because all other call mechanisms can simulated (maybe not call by name, which was
introduced with ALGOL 60 and is very special).

Kind regards

Bernd

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to