As I pointed out earlier, C
NEVER passes arguments by reference.

There is only one (kind of) exception to this rule, that is:
the name of a vector is always the same as the address of its first element,
that is

if x is a vector, then x is the same as &x[0],

so if you pass x (a vector) to a function, the address of the vector is
passed to the function.

This is not true for structures, where the whole structure is passed by value,
that is, copied into the argument list.

But again: the equation (x the same as &x[0]) is not limited to function calls,
it is true everywhere.

HTH

kind regards

Bernd



Am 30.06.2013 20:11, schrieb Steve Comstock:

My whole point was to address the assertion from an
earlier point in this thread that C invariably passes
arguments by reference.

As usual, the simple answer is 'it depends' and, as Shmuel
points out, the devil is in the details.



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

Reply via email to