A delegate function

I have created a library where you can register to a local function to be called by it .

The thing is, if I set the delegate from an arduino sketch , it works great, but if I set it from another class inside the library - I get an error .

classA .h:

#include "classB.hpp"

    class classA
    {
    public:

        classA();
        classB *b ;
        float someDelegate(char *arg); // a method I would like to call from B

classA .cpp: ( just part of it )

#include "classA.hpp"


classA::classA()
{

    b=new classB();  // instance of B

    ***QUESTION IS HERE- WHAT TO PASS TO THE FUNCTION****    

    b>-setDelegate(someDelegate)   this line in an arduino sketch works, but when inside this class (on the library) you get many errors.


 }

On classB .h I have :

    class classB
{


public:

    classB( );
    float (*fpAction)(char*) = 0 ;
on classB.cpp :

void classB::setDelegate( float(*fp)(char*))
{
    fpAction=fp;  //set the pointer for the delegate

}

How do you get this effect , so that classB can call a member function in A ?

Why setting in an Arduino sketch the delegate works with this: (?)

classB B()
B.setDelegate(someDelegate)

//WORKS AS EXPECTED INSIDE ARDUINO SKETCH

in the classA .cpp, what is the function you are trying to pass? how does the class know about this function?

c++ does not allow taking the address of any member function of a class, except static member functions. Member functions need to know which INSTANCE of a class they are being called by, and there is no way to youo to provide that information in the way you're attempting.

If you want delegates, you'll have to go back to using c#...

Regards,
Ray L.