by SarahBishop » Tue Aug 15, 2017 11:57 am
BY reference means that any changes made by the sub program to the variables it received are visible by the calling program.
BY content means that the calling program is passing only the contents of the literal or identifier. With a CALL…BY CONTENT, the called program cannot change the value of the literal or identifier in the calling program, even if it modifies the parameters it received.
BY value means that the calling program is passing the value of the literal, or identifier, not a reference to the sending item. The called program can change the parameter in the called program. However, because the sub program has access only to a temporary copy of the sending item, those changes don't affect the argument in the calling program
The major difference between call by value and call by reference is that in the call by value a copy of actual arguments is passed to respective formal arguments. While, in call by reference the location (address) of actual arguments is passed to formal arguments, hence any change made to formal arguments will also reflect in actual arguments.