I just want to make sure that I do it properly. The first part asks what is the output if the values are pasted by result-value and z-address[w] is calculated at the time of the call. I had:
From my understanding is since z[w] is calculated at the time of the call then z would have gone into the function instead of z (If it was calculated just before the return). So the output would be similar to going through fair value, right?
Also to call by name I had:
Since it's called by name, the value w will be changed when printing z[w]so he would come out z, which is 20. Since the z can not be changed in the function it would produce 10.
Am I doing it correctly?