title: how to pass an array with different sizes to my c++ function?
body: <p>I'm not sure if this is possible but i'm open to ideas. </p>
  
  <p>I have a c++ function. It does some calculation to arrays that are being defined by users as inputs and will generate two output values. Let's call it "myfunction" and it looks something like this:</p>
  
  <blockquote>
    <p>void myfunction(double array1[18],double array[9],double array [2],double *output1, double *output2)</p>
  </blockquote>
  
  <p>I want to make this function more generic so that it is able to take in arrays of different size. Meaning, I want users of this function to be able to define array inputs of other size.</p>
  
  <p>For example,</p>
  
  <blockquote>
    <p>void myfunction(double array1[81],double array[27],double array [3],double *output1, double *output2)</p>
  </blockquote>
  
  <p>Mathematically, "myfunction" is able to calculate accurate outputs despite the array size. I don't want to make a duplicate of "myfunction" because there are a total of 5 different sets of array size that the user can define as inputs. </p>
  
  <p>Any ideas? thank you in advance</p>