I'm trying to write a mapping function that takes a function pointer, and passes it to another function, but gcc is yelling at me.
Here is an idea of what I'm trying to do.
void map(T thing, void apply(int a, int b, void *cl), void *cl);
void function(T thing, void apply(int a, int b, void *cl), void * cl)
{
for(int i = 0; i < 10; i++)
{
map(thing, apply, cl);
}
}
gcc's complaint:
warning: passing argument 2 of 'map' from incompatible pointer type
Any ideas?