Let's say I have the following function which does some sort of math on a number:
int apply(int (*fp)(int n), int before)
{
printf("before: %d\n", before);
int after = fp(before);
printf("after: %d\n", after);
return after;
}
Is there any way here to infer what *fp
points to within the body of the function? My thought was not, but perhaps there's some utility or other where you can give it a function address and it will return the function/memory label or name. Is that possible to do somehow?