title: Passing a class method as function's argument
body: <pre><code>class ARRAY {
    public:
      int *array;
  
      ARRAY(int size);
  
      void INSERT(int data);
  };
  
  ARRAY::ARRAY(int size) {
      array = new int[size];
  }
  
  void ARRAY::INSERT(int data) {
      array[data] = data;
      return;
  }
  </code></pre>
  <p>This is a class of array.<br />
  And I want to pass a ARRAY class' method to some function's argument that measure a runtime.</p>
  <pre class="lang-cpp prettyprint-override"><code>typedef void (ARRAY::*arrFuncCall)(int);
  
  clock_t measure_time(arrFuncCall func, int iterate) {
      clock_t start = clock();
  
      for (int i = 0; i &lt; iterate; i++)
          func(i);
  
      clock_t end = clock();
  
      return end - start;
  }
  </code></pre>
  <p>But I keep seeing an error in</p>
  <pre class="lang-cpp prettyprint-override"><code>for (int i = 0; i &lt; iterate; i++)
     func(i);
  </code></pre>
  <p>That <code>expression preceding parentheses of apparent call must have (pointer-to-) function type</code> in <code>func</code></p>
  <p>Why am I seeing this error?</p>