:>: -----Original Message----- :>: From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On :>: Behalf Of Bernd Oppolzer :>: Sent: Sunday, June 30, 2013 2:58 PM :>: To: IBM-MAIN@LISTSERV.UA.EDU :>: Subject: Re: Theology question: Parameter formats :>: :>: 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.
Everywhere except when the array name is the operand of the & operator, the operand of the sizeof operator, or in the case of a string literal used to initialize a character array. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN