Function Pointers point to code like normal pointers.
In Functions Pointers, function’s name can be used to get function’s address.
A function can also be passed as an arguments and can be returned from a function.
Declaration
function_return_type(*Pointer_name)(function argument list)
Example
#include<stdio.h> int subtraction (int a, int b) { return a-b; } int main() { int (*fp) (int, int)=subtraction; //Calling function using function pointer int result = fp(5, 4); printf(" Using function pointer we get the result: %d",result); return 0; }
Output
Using function pointer we get the result: 1