Checkpoint 8.10.1.
Which of the parameters in the following code block are pass-by-reference?
void swap (int& x, int& y) {
int temp = x;
x = y;
y = temp;
}
void add (int& z, int q) {
z = z + y;
}
int multiply(int a, int b) {
int total = a * b;
return total;
}
- Correct!
- Pay attention to the placement of the
&
- Pay attention to the placement of the
&