title: Properly implementing an array of class functions
body: <p>I want to make an array of known size of class functions. To do so, I've tried using typedef, but it hasn't been working out so far.
  Also, some functions take no arguments ex. F(), but others do ex. G(int n), and in the typedef, I don't know how to tell it to accept no arguments for some (tried void but it says it is not a type), and to accept arguments for others.</p>
  
  <pre><code> class myClass
  {
      // An array of void functions
      typedef void(myClass::*arrayOfFunctions)();
  
  private:
      arrayOfFunctions array[3] = { &amp;myClass::F, &amp;myClass::G, &amp;myClass::H };
  
      void F() { do stuff; }
      void G(int n) { do stuff involving n; }
      void H() { do stuff; }
  };
  
  </code></pre>
  
  <p>What I have tried:
  I have successfully made an array of void functions in a main with no classes involved which I can call when wanted, so part of the problem seems to be implementing this in a class and using its class functions.</p>
  
  <pre><code>// This works:
  
  typedef void(*arrayOfFunctions)();
  
  void Action1()
  {
      // stuff 1
  }
  
  void Action2()
  {
      // stuff 2
  }
  
  void Action3()
  {
      //stuff3
  }
  
  int main()
  {
      arrayOfFunctions functionArray[] = { Action1, Action2, Action3 };
  
      // Call Action1
      functionArray[0]();
  
      return 0;
  )
  </code></pre>