title: Why is x and y pass-by-value, not reference for the code below?
body: <p>For the code below why are the variables x,y,s pass-by-value while only z is pass-by-reference. </p>
  
  <pre><code>void foo(int* a, int* b, int&amp; 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(&amp;x, &amp;y, z, s);
   cout &lt;&lt; x &lt;&lt; “, ” &lt;&lt; y &lt;&lt; “, ” &lt;&lt; z &lt;&lt;“, ” &lt;&lt; s &lt;&lt;endl;
   return 0;
   }
  </code></pre>