title: Passing function as an argument to different function in different file
body: <p>So, I want to pass function, that is in engine.cpp file, as an argument, and that's what I did:</p>
  
  <pre><code>typedef RFun(*wsk)(double, int);
  
  RFun Engine::f_line(double *&amp;values, int howmany)
  {
      RFun line;
  
      for(int i = 0; i &lt; howmany; i++)
      {
          line.result_values[i] = (2 * values[i]) + 6;
      }
  
      return line;
  }
  
  RFun counter(double *&amp;values, int howmany, wsk function)
  {
      return function(*values, howmany);
  }
  </code></pre>
  
  <p>and now I want to call the counter function in other .cpp file and pass f_line function inside as parameter. How can I achieve that? </p>