What is Function Pointer? Explain with example?

Answer Posted / sanjay bhosale

function pointer is simply a pointer which holds the address of the function so we can call that function by using pointer.
It is helpful in situations where we are required to pass the function pointer as parameter to some previously defined functions.
for e.g.
in comparison method we may pass function pointer for function which will compare 2 items/objects and help to comparison method.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is character constants?

929


What does sizeof int return?

863


What is sizeof return in c?

812


What is string function c?

819


What is the difference between a string and an array?

957


What are called c variables?

809


Can a variable be both const and volatile?

917


What are the advantages and disadvantages of c language?

795


shorting algorithmS

2051


What is dynamic dispatch in c++?

818


hi send me sample aptitude papers of cts?

1923


How main function is called in c?

863


How do you determine whether to use a stream function or a low-level function?

945


Are negative numbers true in c?

812


PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE

1742