What is function pointer and where we will use it

Answers were Sorted based on User's Feedback



What is function pointer and where we will use it..

Answer / 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

What is function pointer and where we will use it..

Answer / bsreddi

A function pointer is a type of pointer in C, C++ and other
C-like programming languages. When dereferenced, a function
pointer invokes a function, passing it zero or more
arguments just like a normal function. In programming
languages like C, function pointers can be used to simplify
code, such as replacing large switch statements.

Is This Answer Correct ?    5 Yes 5 No

Post New Answer

More C Interview Questions

what is the height of tree if leaf node is at level 3. please explain

0 Answers  


Write a C program that reads a series of strings and prints only those ending in "ed"

2 Answers   Accenture,


What is variables in c?

0 Answers  


in one file global variable int i; is declared as static. In another file it is extern int i=100; Is this valid ?

4 Answers   Infosys, NetApp,


What is function prototype in c language?

0 Answers  






What is a program flowchart and how does it help in writing a program?

0 Answers  


Is c++ based on c?

0 Answers  


write a program in reverse the string without using pointer,array,global variable declaration,lib fun only using a function?

5 Answers   HCL,


what is the use of operator ^ in C ? and how it works?

2 Answers  


Write a program to reverse a given number in c?

0 Answers  


What is #pragma statements?

0 Answers  


Explain the importance and use of each component of this string: Foo.Bar, Version=2.0.205.0, Culture=neutral, PublicKeyToken=593777ae2d274679d

1 Answers   TCS,


Categories