What is a pointer to a function? Give the general syntax for the same.

C Programming Language >   Pointer in C Language >   Pointer to Function  

Short Question

1250


Answer:

A pointer holding the reference of the function is called pointer to a function. In general it is declared as follows.

T (*fun_ptr) (T1,T2…); Where T is any date type.

Once fun_ptr refers a function the same can be invoked using the pointer as follows.

fun_ptr();
[Or]
(*fun_ptr)();


This Particular section is dedicated to Question & Answer only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.




Join Our telegram group to ask Questions

Click below button to join our groups.