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

6. Which of the Following is not defined in string.h? A)strspn() B)strerror() C)memchr() D)strod()

2 Answers   Accenture,


How many keywords are there in c?

0 Answers  


HOW TO ANSWER IF ASKED " WHAT KIND OF A PERSON ARE YOU?" I NEED AN ANSWER THAT IMPRESS THE INTERVIEWER

4 Answers  


What is #pragma directive?how it is used in the program? what is its advantages and disadvantages?

2 Answers  


c program to compute AREA under integral

0 Answers   Infosys,






which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +

0 Answers  


FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.

0 Answers   Wilco,


How to write a code for reverse of string without using string functions?

0 Answers   TCS,


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

0 Answers  


Explain void pointer?

0 Answers  


main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); }

11 Answers   CISOC, CitiGroup, College School Exams Tests,


Why c is called object oriented language?

0 Answers  


Categories