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
What is preprocessor with example?
Explain which function in c can be used to append a string to another string?
Which type of language is c?
Write a program for finding factorial of a number.
Why isn't it being handled properly?
What is union and structure?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What is the significance of c program algorithms?
In C programming, what command or code can be used to determine if a number of odd or even?
What is a pragma?
What is the size of enum in c?
What are the features of c language?
Difference between Function to pointer and pointer to function
Write a progarm to find the length of string using switch case?
program to convert a integer to string in c language'