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


Please Help Members By Posting Answers For Below Questions

What is preprocessor with example?

777


Explain which function in c can be used to append a string to another string?

823


Which type of language is c?

825


Write a program for finding factorial of a number.

838


Why isn't it being handled properly?

827


What is union and structure?

772


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

911


What is the significance of c program algorithms?

863


In C programming, what command or code can be used to determine if a number of odd or even?

812


What is a pragma?

868


What is the size of enum in c?

827


What are the features of c language?

816


Difference between Function to pointer and pointer to function

829


Write a progarm to find the length of string using switch case?

1826


program to convert a integer to string in c language'

2180