如果参数传递机制是pass-by-name-result,执行完类C程序后的结果是什么?
procedure swap(int x, int y){
int t = x;
x = y;
y = t;
}
main(){
int v = 1;
int list[5] = {1,3,5,7,9};
swap(v, list[v]);
}
如果参数传递机制是pass-by-name-result,执行完类C程序后的结果是什么?
procedure swap(int x, int y){
int t = x;
x = y;
y = t;
}
main(){
int v = 1;
int list[5] = {1,3,5,7,9};
swap(v, list[v]);
}