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


Please Help Members By Posting Answers For Below Questions

How do I send escape sequences to control a terminal or other device?

613


How do you construct an increment statement or decrement statement in C?

746


explain how do you use macro?

668


Why are algorithms important in c program?

623


Explain what will the preprocessor do for a program?

605






Explain the term printf() and scanf() used in c language?

597


Explain how can you tell whether a program was compiled using c versus c++?

579


What does c value mean?

629


What will the preprocessor do for a program?

593


Write a code to generate a series where the next element is the sum of last k terms.

735


Is linux written in c?

602


What is a lvalue

665


What is a header file?

638


Can you return null in c?

597


What is the difference between strcpy() and memcpy() function in c programming?

628