what is the advantage of function pointer

Answer Posted / mahend

Function pointers are very important while implementing
Callback in C, for instance if Software has layered
archiecture, Function pointer are used bye upper layer to
register with below layer on certain conditions (i.e. some
event or interrupt)

Is This Answer Correct ?    72 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the symbol indicated the c-preprocessor?

696


why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above

645


How can I implement sets or arrays of bits?

607


what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above

677


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 ].

643






What is sizeof array in c?

593


When do we get logical errors?

637


Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given

2517


1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures

2740


Explain the advantages and disadvantages of macros.

624


How are structure passing and returning implemented?

588


Why is extern used in c?

612


What is atoi and atof in c?

618


What would be an example of a structure analogous to structure c?

576


which type of aspect you want from the student.

1701