title: Pass by reference through multiple functions
body: <p>Hey all. I'm working on a project for school where I need to pass a few parameters by reference through multiple functions. I understand how I can pass by reference from where the variables are declared to another function, like this: </p>
  
  <pre><code>main() {
    int x = 0;
    int y = 0;
    int z = 0;
  
    foo_function(&amp;x, &amp;y, &amp;z);
  }
  
  int foo_function(int* x, int* y, int* z) {
    *x = *y * *z;
    return 0;
  }
  </code></pre>
  
  <p>However, how would I pass x, y, and z from foo function to another function? Something like this gives me all kinds of compiler warnings.</p>
  
  <pre><code>int foo_function(int* x,  int* y, int* z) {
    *x = *y * *z;
    bar(&amp;x, &amp;y, &amp;z);
    return 0;
  }
  
  int bar(int* x, int* y, int* z) {
    //some stuff
  }
  </code></pre>