On Wed, 3 Jul 2024 18:19:35 +0000, Eric Rossman wrote:

>The pointer is not modifiable. The storage to which it points may be. 
>
In some languages the *local* pointer passed by value
is modifiable.  Example in POSIX (not IBM) C:
#include <stdlib.h>
#include <stdio.h>

int main( int argc, char *argv[] ) {
    printf( "Raw:  %s\n", argv[ 0  ] );
    argv[ 0 ] = realpath( argv[ 0 ], NULL );
    printf( "Real: %s\n", argv[ 0  ] );
    return( 0 ); }

> ... While some languages might abstract away the actual pointer,
>
Such as Pascal formal parameters qualified VAR.


>________________________________
>From:  Paul Gilmartin 
>Sent: Wednesday, July 3, 2024 12:07:02 PM
>
>On Wed, 3 Jul 2024 15:48:16 +0000, Eric Rossman wrote:
>
>>>call by value where the value is an address
>>That's the definition of call by reference.
>>
>Not quite.  Only in the former case the called routine receives
>a modifiable local copy of that pointer.  In the latter, no
>pointer is visible.

-- 
gil

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

Reply via email to