What is function pointer and where we will use it

Answer Posted / raghanna

A function pointer is a variable that stores the address of a function that can later be called through that function pointer. This is useful because functions encapsulate behavior. For instance, every time you need a particular behavior such as drawing a line, instead of writing out a bunch of code, all you need to do is call the function.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.

1934


Explain the priority queues?

870


i have a written test for microland please give me test pattern

2492


How are variables declared in c?

857


What is the use of sizeof () in c?

790


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?

823


What does 4d mean in c?

1246


Can we assign string to char pointer?

826


What is the meaning of ?

827


Write a program on swapping (100, 50)

881


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

1027


Write a program to reverse a linked list in c.

887


Explain what are preprocessor directives?

841


What is pass by reference in functions?

566


How can I insert or delete a line (or record) in the middle of a file?

809