Function Pointers

Joined
Jan 29, 2011
Messages
3
Reaction score
0
Why we use function pointers?

Eg:
Roughly I written the code for understanding purpose only...

char (*ptr_fun)(); // pointer to a function which returns char
char fun();
char ch;
ptr_fun = &fun; // assign the address of that fun to that pointer


Now the question is, what is the different between the below two function call even though both perform the same operation
ch = fun();
ch = *ptr_fun;

Kindly explain in advanced(detailed) manner.
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top