I was revisiting function pointers in C using the following simple code:
unsigned TestFn(unsigned arg)
{
return arg+7;
}
unsigned Caller(unsigned (*FuncPtr)(unsigned), unsigned arg)
{
return (*FuncPtr)(arg);
}
I called it using
Caller(TestFn, 7) //and
Caller(&TestFn, 7)
both gave the same output : 14. What's the explanation of this. I had been using the second way of calling earlier.