• edited by
1,489 views
1 1 vote
Consider 2 cases:

1. Call by value result

2. Call by reference

int x = 10 ;
main ( )
{
P(x); printf (x);
}
P ( int a)
{
If ( a ≤ 40 )
{
a = a +10;
P(a);
x=a+10;
}
}
Please explain this in the above referenceIn case of call by reference the value of the actual parameter is simultaneously updated whereas, in case of call by value result, the final value of a formal parameter is passed to actual.
Any example in which these 2 will differ in output(especially in case of function calls)?

Please log in or register to answer this question.

Position:
Show:

Related questions

1 1 vote
1 1 answer
331
331 views
khanshahima4 asked Sep 24
331 views
1. If precedence tells me which operator has priority, and associativity tells me how to handle operators at the same level, then why do I need a separate concept called ...