What is the difference between the function pointer and pointer to a function

Questions by rupunenisuresh

Showing Answers 1 - 6 of 6 Answers

Function pointers are actually pointers. The address of a function gets pointed to by function pointer.
Example of defining a function pointer is as below:
int (*exforsys)(int,float)= NULL;     

  Was this answer useful?  Yes

Pointers to functions concept is used in C programming language in various instances. One of the common instance in which programmers use pointers to function concept is for passing pointers to a function as the name implies.

For example the below declares a pointer to a function:
int (*exforsys) ();

Then a function say int test() can be assigned to it as below:
exforsys=&test;

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions