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
Explain how do you declare an array that will hold more than 64kb of data?
Difference between Shallow copy and Deep copy?
What are qualifiers and modifiers c?
Is there a way to jump out of a function or functions?
Is Exception handling possible in c language?
What is mean by data types in c?
Linked lists -- can you tell me how to check whether a linked list is circular?
Are the outer parentheses in return statements really optional?
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
I need testPalindrome and removeSpace
#include
What is the difference between new and malloc functions?
Give the rules for variable declaration?
Why we use break in c?
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
What does int main () mean?