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 |
write a recursive program in'c'to find whether a given five digit number is a palindrome or not
If I want to initialize the array like. int a[5] = {0}; then it gives me all element 0. but if i give int a[5] = {5}; then 5 0 0 0 0 is ans. what will I do for all element 5 5 5 5 5 in a single statement???
What is a static variable in c?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
what is software?
Do you have any idea how to compare array with pointer in c?
Explain what are bus errors, memory faults, and core dumps?
Write a program using two-dimensional array that lists the odd numbers and even numbers separately in a 12 input values.
what is the value of b if a=5; b=++a + ++a
31 Answers Infosys, TCS, Tech Mahindra,
what is ans for this scanf(%%d",c);
What is difference between && and & in c?
Why header files are used?