title: C++ return array from function
body: <p>I need to read in an array to my function, extract the data, and then return an array from the function.</p>
  
  <p>The array will only ever hold 2 values.</p>
  
  <p>This is what I want to do in concept:</p>
  
  <pre><code>int myfunction(int my_array[1])
  {
      int f_array[1];
      f_array[0] = my_array[0];
      f_array[1] = my_array[1];
  
      // modify f_array some more
  
      return f_array;
  }
  </code></pre>
  
  <p>I've read up about pointers etc but have got very confused and would appreciate a really basic example of how best to approach this!</p>
  
  <p>Thanks!</p>