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
Does c have class?
what will be the output for the following main() { printf("hi" "hello"); }
What is a nested loop?
What are directives in c?
Why do we use return in c?
What is null pointer in c?
Why header files are used?
What are qualifiers and modifiers c?
How can I read a binary data file properly?
What is the purpose of sprintf() function?
Explain what is operator promotion?
Difference between constant pointer and pointer to a constant.
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
What is uint8 in c?
What is the use of parallelize in spark?