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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is new line escape sequence?

1357


What is wrong with this code?

1188


Are the outer parentheses in return statements really optional?

1118


What are the functions to open and close the file in c language?

1041


What is a macro?

1114


program for reversing a selected line word by word when multiple lines are given without using strrev

2482


Explain how do you view the path?

1178


What is the modulus operator?

1214


What is the difference between declaring a variable by constant keyword and #define ing that variable?

3374


What is type qualifiers?

1136


Do array subscripts always start with zero?

1304


Write a program to generate random numbers in c?

1103


please send me the code for multiplying sparse matrix using c

2178


Explain how do you print only part of a string?

1222


a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);

1143