所以这是我的代码,我知道按值调用的输出是
Here is f
main: z = 15
如果一种语言使用名称调用而不是值调用会怎样?
int f() {
cout << "Here is f" << endl;
return 5;
}
int g(int a) {
int x = a;
int y = 2 * a;
return x + y;
}
int main() {
int z = g(f());
cout << "main: z = " << z << endl;
}