For the code below why are the variables x,y,s pass-by-value while only z is pass-by-reference.
void foo(int* a, int* b, int& c, int d) {
*a = *a + 1;
b = b + 1;
c = c + 1;
d = d + 1;
}
int main() {
int x = 0, y = 5, z = 10, s = 20;
foo(&x, &y, z, s);
cout << x << “, ” << y << “, ” << z <<“, ” << s <<endl;
return 0;
}