title: How do I use function pointers to initialize an object inside a class?
body: <p>I have 3 classes - a superclass, a subclass, and a container class. 
  My superclass has the following constructor:</p>
  
  <pre><code>Superclass(char* t,int(*i)(myType),int a,int b,int c,int p){
      T=t;
      I=i;
      A=a;
      B=b;
      C=c;
      P=p;
  }
  </code></pre>
  
  <p>And the subclass constructor:</p>
  
  <pre><code>Subclass(char* t,int(*i)(myType),int a,int b,int c,int p)
    : Superclass(t,i,a,b,c,p){;}
  </code></pre>
  
  <p>The container class contains multiple pointers to objects of the subclass type:</p>
  
  <pre><code>class Container{
    public:
      char x[2000];
      int funct(myType);
      ...
      Subclass* S;
      ...
      Container(){
        S= new Subclass(x,&amp;funct,3,4,2000,0);
        ...
      }
  }
  </code></pre>
  
  <p>I get a compiler error on the above line 
  "S= new ..." with the message:</p>
  
  <pre><code>"Error: No instance of 'Subclass::Subclass' matches the argument list
  argument types are: (char[2000],int(Container::*)(myType),int,int,int,int)"
  </code></pre>
  
  <p>I believe (though I'm not certain) the error has something to do with the function pointer being passed. I've used function ptrs in a similar manner, but it seems to not like that its pointing to a function inside the Container class. Any suggestions?</p>
  
  <p>Thanks in advance for the help.</p>