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

Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

5901


A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream

1126


What is a newline escape sequence?

1062


How can I invoke another program (a standalone executable, or an operating system command) from within a c program?

1145


What does static variable mean in c?

1068


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2027


How do you define CONSTANT in C?

1218


What is the acronym for ansi?

1003


Explain is it valid to address one element beyond the end of an array?

1157


What is the purpose of the preprocessor directive error?

1210


What does 1f stand for?

1099


Which one would you prefer - a macro or a function?

1041


What is methods in c?

1038


can we have joblib in a proc ?

2242


How can I ensure that integer arithmetic doesnt overflow?

1103