title: Returning Multiple Values from a Function
body: <p>Hey, so I'm making an iPhone app and in there is a common function that needs to be called.  So I put it in it's own file and set it up, passing the parameters to that and all that.  However, I'm not sure how best to return the values from the function.  I read up trying to return the values in an array, but I'm not sure how to do it.</p>
  
  <pre><code>int EndOfTurn(int varTurns, int varFatness)
      {
          varTurns--;
  
          if (varTurns &lt;= 0) {
              varFatness = varFatness - 5;
          }
          else {
              varFatness += 2;
          }
  }
  </code></pre>
  
  <p>I need to return both varTurns and varFatness.  However, this function will become more complicated, with me returning as many as 10 variables.</p>
  
  <p>As of now, it is written in C, not Objective-C, (I just added a .c file to the Project), but I can change that.  It needs to simply return all the updated values that I used in the function.  If you could, write up the declaration of the function and the type:</p>
  
  <pre><code>TYPE_HERE EndOfTurn(int varTurns, int varFatness)
  </code></pre>
  
  <p>so I know exactly how to do it.  Thanks, and I hope I gave enough info!</p>