Call By Value & Call By Reference
FORMAL PARAMETER - These are the parameters which appear in the function definition or declaration is called Formal Parameter.
ACTUAL PARAMETER - These are the parameters which appear in the function call is called Actual Parameter.
Call By Value -
In Call By Value , value of actual parameter is copied into Formal Parameter.
The function work on formal parameter only.
Actual parameter is intact.
Change are not reflected is called function.
Call By Reference -
In this type, instead of copying a value of actual parameters into formal parameter, the function receive address of the actual parameter.
Works on the original value,
Changes are reflected in the calling function.
Summary -
By - Somesh Sah
Comments
Post a Comment