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
how can f be used for both float and double arguments in printf? Are not they different types?
please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................
Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80
How do I create a directory? How do I remove a directory (and its contents)?
What is time complexity c?
Define the scope of static variables.
What is the purpose of main( ) in c language?
How many bytes are occupied by near, far and huge pointers (dos)?
Explain what are reserved words?
What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?
Why do some versions of toupper act strangely if given an upper-case letter?
Why pointers are used?
Why c is faster than c++?
What language is windows 1.0 written?
What are the key features in c programming language?