title: Assigning function pointer to a variable
body: <p>I'm trying to assign function pointer to a variable (the variable located in the base class) in derived class constructor.</p>
  <p><em><strong>My Code:</strong></em></p>
  <pre><code>class A {
   public:
    virtual void print()=0;
   protected:
    unsigned long (*func)(unsigned char *,int)
  }
  unsigned long A::f1(unsigned char *c,int a){...}
  unsigned long A::f2(unsigned char *c,int a){...}
  
  class B: public class A {...}
  B::B(int which){
  switch (which){
   case 1:
    func=f1; //first error
    break;
   case 2:
    func=f2; //second error
    break;
  }
  </code></pre>
  <p><em><strong>Error:</strong></em></p>
  <blockquote>
  <p>error: cannot convert 'A::f1' from type 'long unsigned int (A::)(unsigned char <em>,int)' to type long unsigned int (</em>)(unsigned char *,int)'</p>
  <p>error: cannot convert 'A::f2' from type 'long unsigned int (A::)(unsigned char <em>,int)' to type long unsigned int (</em>)(unsigned char *,int)'</p>
  </blockquote>