Sample code for using function pointer in a C program:
What is the output of below C program.
fp = fun;
crash at run time
compile time error, invalid operation.
This is an example of how to use function pointers. fp is the function pointer which stores the address of function fun(). so on calling (*fp)(); it is indirectly calling the function fun().
Back To Top