Thursday, 31 May 2012

PARAMETER PASSING MECHANISM


1.CALL BY VALUE:- In this, values of actual parameters are passed to the called function. these values are assigned to the corresponding formal parameters. A called function may allocate memory to a formal parameter & copy the value of actual parameter into this location at every call  .
1.CALL BY REFERENCE:- In this, the address of actual parameters is passed to the called function. If the parameter is an expression ,its value is computed & stored in a temporary location & the address of temporary location is passed to the called function. If the parameter is an array element, its address is similarly computed at the time of call.
 

2 comments: