19 Q. Where the function pointers can be used?

Love and Share

Answers : By definition, a function pointer is a variable that stores the address of a function. It can later be called anytime, to execute the function it points to.

One important use of function pointer is that it can be used when if/switch statements are present,in late binding(variation tables) and to implement call backs activities. So, Function pointers can be useful when you want to create callback mechanism, and need to pass address of an function to another function.

 It can also be used as Arguments to Other Functions or when you want to store an array of functions, to call dynamically

Love and Share

Leave a Reply

Your email address will not be published. Required fields are marked *