what is the advantage of function pointer
Answer Posted / dwight schrute
suppose u have 2 files:
file1 has following functions:
A1
B1
C1
file12 has following functions:
A2
B2
C2
scenario:
A1 needs to use A2 in turn A2 needs to use B1.
A1 invokes A2;
A2 invokes B1;
for B1 to be available in file2 either shld be extern or in
header file which in turn exposes it to entire file2.
In order to minimize this exposure "pass B1 as a functional
pointer to A2".
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What are the 5 data types?
What is the right type to use for boolean values in c? Is there a standard type?
What will the preprocessor do for a program?
Write a program to know whether the input number is an armstrong number.
What is a pointer in c?
Why is python slower than c?
How can I do graphics in c?
Can you think of a logic behind the game minesweeper.
When should you use a type cast?
Is flag a keyword in c?
What is typedef?
What is a function simple definition?
What is c language and why we use it?
Why is #define used?
What is main () in c?