what is a function pointer and how all to declare ,define
and implement it ???
Answer Posted / mathiyazhagan
A function can itself stored in a memory address.By calling
the address ,instead of function name,we can invoke
function.
Eg.:
#include <stdio.h>
void sum(int,int);
{
void (*fp)(); //() denotes pointer to a function
fp=sum(); // no need & .reason : same of array
fp(10,20); //invoking function
}
void sum(int x,int y)
{
printf("sum of x%d and %d is =%d",x,y,x+y);
}
| Is This Answer Correct ? | 1 Yes | 5 No |
Post New Answer View All Answers
How to Throw some light on the splay trees?
Hi can anyone tell what is a start up code?
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
What is multidimensional arrays
Why can’t we compare structures?
In which header file is the null macro defined?
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
Why calloc is better than malloc?
how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....
When should structures be passed by values or by references?
how could explain about job profile
What is a stream?
What is 1d array in c?
Explain what is the difference between text files and binary files?
How are strings stored in c?