Difference between Call-by-name and Call-by-macro-expansion
问题 Let's assume we have the following code in a language that looks a lot like C. int A[2]; A[0]=4; A[1]=7; void f(int x, int y) { x++; A[1]++; y++; printf(x, y, A[0], A[1]); } void main() { int k = 0; f(k, A[k]); print(k, A[0], A[1]); } I want to define the output of this program. I haven't understood well the difference between the call-by-name and the call-by-macro-expansion method. So, in the call-by-name method, k is initialized to 0 and then f() function is called. x becomes equal to "k"