title: Passing addresses to functions in C
body: <p>I'm new to C and I have a function that calculates a few variables. But for now let's simplify things. What I want is to have a function that "returns" multiple variables. Though as I understand it, you can only return one variable in C. So I was told you can pass the address of a variable and do it that way. This is how far I got and I was wondering I could have a hand. I'm getting a fair bit of errors regarding C90 forbidden stuff etc. I'm almost positive it's my syntax.</p>
  
  <p>Say this is my main function:</p>
  
  <pre><code>void func(int*, int*);
  
  int main()
  {
      int x, y;
      func(&amp;x, &amp;y);
  
      printf("Value of x is: %d\n", x);
      printf("Value of y is: %d\n", y);
  
      return 0;
  }
  
  void func(int* x, int* y)
  {
      x = 5;
      y = 5;
  }
  </code></pre>
  
  <p>This is essentially the structure that I'm working with. Could anyone give me a hand here?</p>