Subject: | |
From: | |
Reply To: | |
Date: | Wed, 29 Oct 1997 22:35:58 -0800 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
"Anderson, Michael" <[log in to unmask]> wrote:
>I was troubled with this same problem for at least two hours until I
>finally figured out that I needed to put the "&" ampersand in front of
>the parameters in question. I'm not sure what the ampersand does for the
>"C" compiler, I know it doesn't correspond to the USING and GIVING in
>COBOL, it's closer to the BY REFERENCE or BY VALUE. Any further
>explanations will be humbly accepted.
The ampersand tells C that you want the address of the variable. In COBOL
all the variables are passed by reference anyway, so no ampersand is
needed. HP has a special format using "\"s to indicate that you are
passing a variable by value (only used, of course, when calling a system
intrinsic or non-COBOL program). The compiler knows whether a variable has
to be passed by value or by reference if you use "CALL INTRINSIC", so you
can usually just miss out the "\"s. C is much less forgiving, but allows
you to do things that would be very difficult to do in COBOL. Yer pays yer
money and yer takes yer choice.
John D. Alleyn-Day
Alleyn-Day International
408-286-6421 408-286-6474 (Fax)
[log in to unmask] http://www.Alleyn-Day.com
|
|
|