I have a doubt regarding Pass By Name
Procedure test ( int c, int d)
{
int k = 10;
c = 5;
d = d + 2 ;
k = c + d;
print (k);
}
main()
{
k = 1;
test(k,k);
print (k);
}
I did refer to one of the earlier question on what is pass by name and how does it work
and the link given in it :
Pass by name parameter passing
The Question i have is : will the above code print : ( 14 , 1 ) or (14, 14)
Basically doubt is whether the value of k in procedure be reflected in main procedure or not.
I'm preparing for an exam. This's a code snippet given in one of the question bank.