I want to call a C API from C++. The API expects a function pointer, though for me the functionality is implemented in a C++ function object because it has state.
In fact the desired functionaliity is split across into two function objects. The C api expects a function that has two pointer parameters for returning the two things that each of the function objects return.
Apart from defining a global function is there any way of using the function object from C. For example can it be reinterpret_casted to a function pointer ?
EDITS:
For simplicity its ok to assume that the signature of the call back is void (*f)(void*, int*, int*)
Oh and it has to be C++-03