I have a function that recives as one of the parameters a function pointer.
If i want to pass a class method as that function, how do I do it?

I tryed like this:

class C
{
public:
   SetVector( vector<UTF16> );
};

//function prototype
void function( const string sToPlace,  void(*setter)(vector<UTF16>) );

and i call it like this:

function( stringVariable, objC->SetVector ); //where objC is an instance of C class

but it doesn't seem to work. the functoin is supose to do some string manipulating on the stringVariable, extract a vector from int and call the setter

Recommended Answers

All 2 Replies

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.