title: Pass reference to output location vs using return
body: <p>Which is better for performance when calling a function that provides a simple datatype -- having it fill in a memory location (passed by pointer) or having it return the simple data?</p>
  
  <p>I've oversimplified the example returning a static value of 5 here, but assume the lookup/functionality that determines the return value would be dynamic in real life...</p>
  
  <p>Conventional logic would tell me the first approach is quicker since we are operating by reference instead of having to return a copy as in the 2nd approach... But, I'd like others' opinions.</p>
  
  <p>Thanks</p>
  
  <p><code>
  void func(int *a) {
      *a = 5;
  }
  </code></p>
  
  <p>or...</p>
  
  <p><code>
  int func() {
      return 5;
  }
  </code></p>