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 scope of an external variable in c?

0 Answers  


In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.

0 Answers  


The code is::::: if(condition) Printf("Hello"); Else Printf("World"); What will be the condition in if in such a way that both Hello and world are printed in a single attempt?????? Single Attempt in the sense... It must first print "Hello" and it Must go to else part and print "World"..... No loops, Recursion are allowed........................

14 Answers   HOV Services, IBM, Potty,


Explain About fork()?

0 Answers   TISL,


Can you add pointers together? Why would you?

0 Answers  


# define x=1+4; main() { int x; printf("%d%d",x/2,x/4); }

5 Answers  


What is the difference between i++ and i+1 ?(in terms of memory)

3 Answers   HCL,


What is a function in c?

2 Answers  


suppose there are five integers write a program to find larger among them without using if- else

2 Answers  


Who developed c language?

0 Answers  


int *a[5] refers to

12 Answers   TCS,


process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,

0 Answers   InterGraph,


Categories