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 Function Pointer? Explain with example?

Answers were Sorted based on User's Feedback



What is Function Pointer? Explain with example?..

Answer / inderchauhan

A pointer is a special kind of variable in C and C++ that
holds the address of another variable.


my first pointer
#include <iostream>
using namespace std;

int main ()
{
int firstvalue, secondvalue;
int * mypointer;

mypointer = &firstvalue;
*mypointer = 10;
mypointer = &secondvalue;
*mypointer = 20;
cout << "firstvalue is " << firstvalue << endl;
cout << "secondvalue is " << secondvalue << endl;
return 0;
}



firstvalue is 10
secondvalue is 20

Is This Answer Correct ?    1 Yes 1 No

What is Function Pointer? Explain with example?..

Answer / sanjay bhosale

function pointer is simply a pointer which holds the address of the function so we can call that function by using pointer.
It is helpful in situations where we are required to pass the function pointer as parameter to some previously defined functions.
for e.g.
in comparison method we may pass function pointer for function which will compare 2 items/objects and help to comparison method.

Is This Answer Correct ?    0 Yes 0 No

What is Function Pointer? Explain with example?..

Answer / mahi

pointer is a variable witch can strore address of another
variable

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

Are pointers integer?

0 Answers  


Write a c program using for loop in switch case?

1 Answers   Infosys,


What is meant by recursion?

0 Answers   ADP,


What is auto keyword in c?

0 Answers  


What is c definition?

0 Answers  


Explain how can I make sure that my program is the only one accessing a file?

0 Answers  


what is the output of the code and how? main() { int *ptr,x; x=sizeof(ptr); printf("%d",x); }

1 Answers  


write a program for egyptian fractions in c?

1 Answers   Satyam,


What is pointer and structure in c?

0 Answers  


how to find out the reverse number of a digit if it is input through the keyboard?

6 Answers  


What is a wrapper function in c?

0 Answers  


What are multidimensional arrays?

0 Answers  


Categories