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 void pointer?
Are there any problems with performing mathematical operations on different variable types?
Explain high-order bytes.
What does the characters “r” and “w” mean when writing programs that will make use of files?
What is echo in c programming?
What is selection sort in c?
What language is c written?
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
Explain pointers in c programming?
What is #error and use of it?
Define recursion in c.
Differentiate between declaring a variable and defining a variable?
How can I recover the file name given an open stream or file descriptor?
plz let me know how to become a telecom protocol tester. thank you.