50. 執行下列 C 語言程式碼,探討傳值呼叫(Call by Value)與傳址呼叫(Call
by Address)的差異。請問程式最後印出的數值為何?
#include
void update(int a, int *b) {
a = a * 2;
*b = *b + 3;
}
int main() {
int x = 5, y = 10;
update(x, &y);
printf("%d %d", x, y);
return 0;
}

(A) 5 13

(B) 10 13

(C) 10 10

(D) 5 10

答案:登入後查看
統計: A(0), B(0), C(0), D(1), E(0) #3911416