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
How do I send escape sequences to control a terminal or other device?
How do you construct an increment statement or decrement statement in C?
explain how do you use macro?
Why are algorithms important in c program?
Explain what will the preprocessor do for a program?
Explain the term printf() and scanf() used in c language?
Explain how can you tell whether a program was compiled using c versus c++?
What does c value mean?
What will the preprocessor do for a program?
Write a code to generate a series where the next element is the sum of last k terms.
Is linux written in c?
What is a lvalue
What is a header file?
Can you return null in c?
What is the difference between strcpy() and memcpy() function in c programming?