why we need function pointers?
Answers were Sorted based on User's Feedback
Answer / kirankumaryakkala
a pointer that holds the address of a function.
in writing the interrupt service routines(isr),memory virus
programs, etc..
as simply, if u wanna execute one function out of two or
more funcitons( the selection based dynamically)
ex. int add(int a, int b)
int sub(int a, int b)
int mul(int a, int b)
int (*ptr)(int a, int b) //function pointer declaration to
hold a function that takes two integers, returns one integer
here,
ptr= it can assign any function name that is going to execute
| Is This Answer Correct ? | 11 Yes | 2 No |
Answer / naman patidar
Apart from above mentioned usage function pointer are used
by event listeners and callback utilities in multi threaded
applications.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / gajendra
Function Pointers are pointers, i.e. variables, which point to the address of a function. You must keep in mind,
that a running program gets a certain space in the main-memory. Both, the executable compiled program code
and the used variables, are put inside this memory.
| Is This Answer Correct ? | 0 Yes | 0 No |
Can an array be an Ivalue?
What's the difference between a linked list and an array?
How can I return multiple values from a function?
List a few unconditional control statement in c.
what are advantages of U D F?
What does a run-time "null pointer assignment" error mean?
How can I read in an object file and jump to locations in it?
being a chemical engineer and with an aggregate of 80% why you opt for TCS and not your core industry?
what will be maximum number of comparisons when number of elements are given?
write a Program to dispaly upto 100 prime numbers(without using Arrays,Pointer)
26 Answers ADITI, iFlex, Infosys, Oracle, TCS, Unicops, Wipro,
formula to convert 2500mmh2o into m3/hr
What is calloc() function?