I am trying to make a function taking as one argument another function. This passed function is of type:
void SomeFunc(int blabla)
{
//do something
}
How do I define properly this function to which I pass the mentioned one? Is this fine?
SomeRetValuetype Func( void (AFunction(int)) )
{
//do some stuff
AFunction(someintvalue);
//do some stuff
}
Is the example from above ok?
When I made this argument passing the way defined for other functions (as I did usually) I get a bunch of errors:
SomeRetValuetype Func( void (*AFunction(int)) )
{
//do some stuff
AFunction(someintvalue);
//do some stuff
}
on GCC:
error: invalid conversion from 'void (*)(void*) {aka void (*)(void*)}' to 'void* (*)(void*)' [-fpermissive]|
Thanks in advance for any suggestions,
Misery