Class member function pointers in C++
<p>I want to call a member function of another class on an object, but I cant seem to figure out how this works. As example code on how it should work:</p>

<pre><code>Class A {
  void somefunction(int x);
}

Class B : A {
  void someotherfunction(int x);
}

Class C {
  void x() {
      callY(&amp;ofthefunction); 
}   //here you call the function, you dont have an object yet,    and you don't know the argument yet, this will be found in function callY

  void Y(*thefunction) {
       find int x;
       if(something)
             A a = find a;
             a-&gt;thefunction(x);
       else 
             B b = find b;
             b-&gt;thefunction(x);
}
}
</code></pre>

<p>I hope this makes sence, It is also possible to split this in 2 methods, Y1 and Y2, but seeing as 90% of the code is the same (finding things in a XML file), only the object and argument where to save it is different, i'd like to do this</p>
