In particular, will the following work as expected:
typedef void(*func_p)(void*); void foo(int* data) { printf("%i\n",*data); } int main(int argc, char** argv) { func_p bar; int x = 42; bar = foo; bar((void*)&x); return 0; }
those. is it possible to rely on data pointers ( void* , int* , struct baz* , but not necessarily void(*)(void) ), always passed compatible?
c casting function-pointers
David x
source share