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 are types of structure?

1169


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1764


Write a Program to find whether the given number or string is palindrome.

1334


What does the && operator do in a program code?

1279


What is the value of uninitialized variable in c?

1088


What is malloc() function?

1227


Is there sort function in c?

1063


What is self-referential structure in c programming?

1275


What is typedf?

1160


Explain the array representation of a binary tree in C.

1279


What is the benefit of using #define to declare a constant?

1146


Why c is called free form language?

1072


Can we declare variable anywhere in c?

1030


What are structure types in C?

1151


.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }

1368