Absolute C++ Chapter 4 Self-Test Exercise(1)
1.A call-by-value parameter is a local variable. When the function is invoked, the value of a callby-
value argument is computed and the corresponding call-by-value parameter (which is a
local variable) is initialized to this value.
2.yes
3.
10 20 30
1 2 3
1 20 3
4. the first won't change to the second, but the second will become as the first.
5.
void zeroBoth(int& num1,int& num2) { num1=0; num2=0; }
6.
void addTax(double taxRate, double& cost) { cost*=(1+taxRate/100.0) }
7. it won't change to 222 the second argument.
8.int score(double points);
9.double theAnswer(double data1, double data2);

浙公网安备 33010602011771号