title: C++ pointer to member function, declaration
body: <p>I have the following class:</p>
  
  <pre><code>class Point2D
  {
  protected:
  
          double x;
          double y;
  public:
          double getX() const {return this-&gt;x;}
          double getY() const {return this-&gt;y;}
  ...
   };
  </code></pre>
  
  <p>and pointer to the member function declared in another class:</p>
  
  <pre><code>double ( Point2D :: *getCoord) () const;
  </code></pre>
  
  <p>How to declare/initlialize pointer to the member function for:</p>
  
  <p><em>1] static class member function</em></p>
  
  <pre><code>Process.h
  
  class Process
  {
     private:
        static double ( Point2D :: *getCoord) () const; //How to initialize in Process.cpp?
        ...
  };
  </code></pre>
  
  <p><em>2] non class member function</em></p>
  
  <pre><code>Process.h
  
  double ( Point2D :: *getCoord) () const; //Linker error, how do declare?
  
  class Process
  {
     private:
        ...
  };
  </code></pre>