COMPILER DESIGN

TOOLS AND TECHNIQUES FOR COMPILER DESIGN

MISCELLENOUS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
In the call by value method,
A
changes made in the formal parameters does not affect the actual parameters
B
changes made in the formal parameters affect the actual parameters.
C
changes cannot be made
D
None of the above
Explanation: 

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.

There is 1 question to complete.