P
Patrick Guio
Dear all,
I have a C function that returns a void pointer (void *).
This object pointer is actually a pointer to function.
I have the following declarations:
void *pobj;
double (*func)(double);
I am trying to convert pobj into func with a reinterpret_cast
fun = reinterpret_cast<double (*)(double)>(pobj);
but I get a compiler error that says that ISO C++ forbids casting between
pointer-to-function and pointer-to-object.
Any idea how to force such cast ?
Sincerely,
Patrick
I have a C function that returns a void pointer (void *).
This object pointer is actually a pointer to function.
I have the following declarations:
void *pobj;
double (*func)(double);
I am trying to convert pobj into func with a reinterpret_cast
fun = reinterpret_cast<double (*)(double)>(pobj);
but I get a compiler error that says that ISO C++ forbids casting between
pointer-to-function and pointer-to-object.
Any idea how to force such cast ?
Sincerely,
Patrick