Sunday, 29 September 2013

error: expected primary-expression before ')' when passing function-pointer to a function

error: expected primary-expression before ')' when passing
function-pointer to a function

Following is the function that takes function prototype as an argument:
void callAdded(void (*unitAdded)(rates));
When I do:
callAdded((&ConverterProxy::unitAdded)(rates));
ConverterProxy::unitAdded is a static function and rates is a struct.
Why do I get that error?

No comments:

Post a Comment