7. Consider the following program
segement in C programming language: void swap_met(int i, int j) { int temp;
temp = i; i = j; j = templ } void main() { int val = 3; arrlist[5] = {4, 6,
3, 1, 2}; swap_met(val, arrlist[0]); swap_met(arrlist[0], arrlist[1]);
swap_met(val, arrlist[var]); } For each of the following parameter passing
methods, what are all of the values of the variables val and arrlist after
each of the three calls to swap_met? Pass by value, (b) Pass by reference,
(c) Pass by value-result. (Describe the binding order you assume.)
--
同樣在一個版灌水 就有十萬篇跟上不了百大的差別
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.45.137.253