what is the advantage of function pointer
Answer Posted / tahir ali
As you probably learned in your first programming courses,
pointers to variables allows you to modify variable contents
from a non-local environment. This gives the flexibility of
writing generic functions which do not alter "known" global
variables, but references to "unknown" variables. Such
functions can be reused. Function pointers gives you the
same flexibility, but at a higher level. Instead of calling
a "known" function, one can call any arbitrary "unknown"
function. This is the main advantage of function pointers:
greater flexibility and better code reuse.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. The Logic should be written in Data Structures?
What is the difference between printf and scanf in c?
What is meant by initialization and how we initialize a variable?
What is file in c preprocessor?
What is a char c?
Explain bitwise shift operators?
What is difference between Structure and Unions?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
How important is structure in life?
What is boolean in c?
How do you determine a file’s attributes?
What is the stack in c?
What are the restrictions of a modulus operator?
Why we use stdio h in c?
What is sizeof array?