Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is a function pointer and how all to declare ,define
and implement it ???

Answer Posted / satish

Function pointer:
a function can be called not only by
its name,but also by other name which is called function
pointer.

void fact(int);
void main()
{
void(*p)(int);
printf("Enter n\n");
scanf("%d",&n);
p=fact;
fact(n);/*normal calling a function*/
(*p)(n); /*fn calling using function pointer*/

}
void (*p)(int n)
{
int ans=1;
while(n>0)
{
ans*=n--;
}

printf(" %d != %d",n,ans);

Is This Answer Correct ?    3 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the significance of scope resolution operator?

1420


What are dangling pointers in c?

1253


Can a program have two main functions?

1135


List the different types of c tokens?

1077


Is there a way to compare two structure variables?

1129


Why does notstrcat(string, "!");Work?

1156


Which built-in library function can be used to match a patter from the string?

1308


Can you explain what keyboard debouncing is, and where and why we us it? please give some examples

2210


Multiply an Integer Number by 2 Without Using Multiplication Operator

772


What should malloc() do?

1179


Explain the red-black trees?

1141


What header files do I need in order to define the standard library functions I use?

1069


Explain modulus operator. What are the restrictions of a modulus operator?

1022


What does static variable mean in c?

1115


How does selection sort work in c?

1050