TOOLS AND TECHNIQUES FOR COMPILER DESIGN
MISCELLENOUS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
changes made in the formal parameters does not affect the actual parameters
|
|
changes made in the formal parameters affect the actual parameters.
|
|
changes cannot be made
|
|
None of the above
|
Detailed explanation-1: -In this parameter passing method, the values of actual parameters get copied to the function’s formal parameters and the two kinds of parameters store in various memory locations. Thus, any changes which get made inside functions do not reflect in actual parameters of the caller.
Detailed explanation-2: -Answer: The call by value technique transfers the value of an argument into the function’s formal parameter. As a result, changes to the main function’s parameter have no effect on the argument.
Detailed explanation-3: -Call by value in C In call by value method, we can not modify the value of the actual parameter by the formal parameter. In call by value, different memory is allocated for actual and formal parameters since the value of the actual parameter is copied into the formal parameter.