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

Why header file is used in c?

785


Is a house a shell structure?

913


What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

1725


Why main function is special give two reasons?

1227


A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(

2011


Write a program to reverse a linked list in c.

868


Can we use any name in place of argv and argc as command line arguments?

834


The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration

853


What is a nested formula?

807


Explain how can I open a file so that other programs can update it at the same time?

877


What is array of structure in c programming?

1024


What is the advantage of using #define to declare a constant?

860


why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???

1731


What are pointers in C? Give an example where to illustrate their significance.

976


Write a program to print "hello world" without using a semicolon?

858