title: C++ Initialization of static function pointer array
body: <p>I want to create a static function pointer array, so I can jump to a certain function regarding a received index. Like an index jumper.</p>
  
  <p>So imagine a class like this:</p>
  
  <pre><code>Class A 
  { 
    private:
    static void 1stFunction();
    static void 2ndFunction();
  
    static void(*functionPointer[20])(void);
  
  };
  </code></pre>
  
  <p>Then I would like that functionPointer to get the value of the 1stFunction and 2ndFunction, and maybe even more.
  So, how do I initialize it?
  As far as I know, when a static member is declared, you can use it even before an instance is created. So I though, lets initialize that function pointer, so later I can call it like this</p>
  
  <pre><code>functionPointer[receivedIndex]();
  </code></pre>
  
  <p>So i tried to initilize it like this, in the same .h file</p>
  
  <pre><code>void (*A::functionPointer[])(void) =
  {
      A::1stFunction,
      A::2ndFunction,
  };
  </code></pre>
  
  <p>But the compiler gives me redifinition, it says it's already created.</p>
  
  <p>So, pretty sure I'm missing something. I don't know though, if it is syntax or simply it is not possible to do it this way.
  I know that function pointers to class's member functions are different than normal function pointers... But this is a static function, so I believe it doesn't belong to an instance and therefore it should work with normal function pointers.</p>
  
  <p>Any help would be appreciated.
  Thanks</p>