title: C++: Return multiple NEW arrays
body: <p>I think this is an easy issue, but it's driving me crazy: I want to return multiple arrays from one method, for which the calling method does not know their size in advance. So I have to create those Arrays inside the method (in contrast to just filling them) and I am not able to return them using <code>return</code>.</p>
  
  <p>So what I would want is a method signature like this:</p>
  
  <pre><code>void giveMeArray(int[] *anArray)
  </code></pre>
  
  <p>Method signature has only one parameter to simplify the examples, please assume I could also have a signature like</p>
  
  <pre><code>void giveMeArrays(int[] *anArray, float[] *anotherArray)
  </code></pre>
  
  <p>Inside that method <code>giveMeArray</code> I would construct the array with</p>
  
  <pre><code>*anArray = new int[5];
  </code></pre>
  
  <p>and I would call that method using</p>
  
  <pre><code>int[] result;
  giveMeArray(&amp;result);
  </code></pre>
  
  <p>However, all this (starting with the method signature) is at least syntactically wrong. Please excuse that I don't have the compiler errors at hand by now, I'm pretty sure some of you will know what's wrong.</p>
  
  <p><strong>EDIT</strong> I <em>know</em> that std::vector would be the best (meaning cleanest) approach. However, folks, that wasn't the question.</p>