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...

why we need function pointers?

Answer Posted / kirankumaryakkala

a pointer that holds the address of a function.
in writing the interrupt service routines(isr),memory virus
programs, etc..
as simply, if u wanna execute one function out of two or
more funcitons( the selection based dynamically)

ex. int add(int a, int b)
int sub(int a, int b)
int mul(int a, int b)

int (*ptr)(int a, int b) //function pointer declaration to
hold a function that takes two integers, returns one integer

here,
ptr= it can assign any function name that is going to execute


Is This Answer Correct ?    11 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what do you mean by inline function in C?

1062


Differentiate between a structure and a union.

1296


A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM

2137


Can we initialize extern variable in c?

1144


What is operator precedence?

1219


Explain what is the difference between null and nul?

1163


Does c have function or method?

1010


How do you determine the length of a string value that was stored in a variable?

1128


What is a structure in c language. how to initialise a structure in c?

1067


Explain the difference between #include "..." And #include <...> In c?

1037


What is a function in c?

1591


Is linux written in c?

1044


How many main () function we can have in a project?

1116


Why does everyone say not to use scanf? What should I use instead?

1425


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

1270