What is the difference between the 'call by value' and 'call by reference'?

Showing Answers 1 - 0 of 0 Answers

shob

  • Apr 24th, 2007
 

Call by reference :
- address of the parameters will be passed to the sub-program. Changes to the parameter in the called program affect the corresponding argument  in the calling program.
Default is call by reference

Call by value:

-only the copy of the contents will be passed to the sub-program.The called program cannot change the value of this parameter as referenced in the CALL statement's USING phrase.

  Was this answer useful?  Yes

Call by value:

This is default in cobol no need to specify the call by value. The changes to the variable in the called program in reflected back in the calling program.

Call by content: 

This should be specified along with call and here the content of the variable is passed to the called program but the changes in the called programwill not be relected in the calling program.

  Was this answer useful?  Yes

Call by reference is default call in Cobol.

Call by Value:
In call by value both the actual and dummy parameters will occupy different memory space.
so the changes made in the subprog will not affect(/modify) the actual parameters in the main prog.

Call by ref:
In call by reference both the actual and dummy parameters will occupy the same memory location.
so the changes made in the subprog will modify the actual parameters in the main program.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions