title: Array of Pointer to Function Inside a Array Of Object
body: <p>I have a class Ghost that has an array of functions. This class Ghost is an
  array too. How do I call the functions in main? I cant find a way to call this functions. I have seen some examples but nothing like this.</p>
  
  <pre><code>class Ghost;
  
  typedef void(Ghost::* Func)();
  
  class Ghost
  {
      public:
      Func func;
  
      public:
  
      void init() {};
      void running_random() {};
      void running_afraid() {};
      void dead() {};
  
  
      Ghost(){
          func = new Func[5];
  
          func[0] = &amp;Ghost::init;
          func[1] = &amp;Ghost::random;
          func[2] = &amp;Ghost::running_afraid;
          func[4] = &amp;Ghost::dead;
      }
  
  };
  
  
  int main()
  {
      Ghost ph[4];
  
      ph[0]-&gt;*func[0](); //???
      ph[0]-&gt;(*func[0]()); //???
      (ph[0]-&gt;*func[0])(); //???
  }
  </code></pre>